From: Sebastian Ott Date: Mon, 14 Jul 2008 07:59:20 +0000 (+0200) Subject: [S390] cio: fix double unregistering of subchannels X-Git-Tag: v2.6.27-rc1~1112^2~26 X-Git-Url: http://pilppa.com/gitweb/?a=commitdiff_plain;h=ef60cd13ecee0ccf2439d63013cbfc798aea2bb9;p=linux-2.6-omap-h63xx.git [S390] cio: fix double unregistering of subchannels In some cases where the channel subsystem decides to drop a subchannel device device_unregister may be called twice, which results in an oops. The patch prevents this by only unregistering registered devices. Signed-off-by: Sebastian Ott Signed-off-by: Heiko Carstens Signed-off-by: Martin Schwidefsky --- diff --git a/drivers/s390/cio/css.c b/drivers/s390/cio/css.c index 4e2f2bbf4ba..46c021d880d 100644 --- a/drivers/s390/cio/css.c +++ b/drivers/s390/cio/css.c @@ -164,7 +164,8 @@ static int css_sch_device_register(struct subchannel *sch) void css_sch_device_unregister(struct subchannel *sch) { mutex_lock(&sch->reg_mutex); - device_unregister(&sch->dev); + if (device_is_registered(&sch->dev)) + device_unregister(&sch->dev); mutex_unlock(&sch->reg_mutex); } EXPORT_SYMBOL_GPL(css_sch_device_unregister);