diff options
author | Sebastian Ott <sebott@linux.vnet.ibm.com> | 2008-07-14 03:59:20 -0400 |
---|---|---|
committer | Heiko Carstens <heiko.carstens@de.ibm.com> | 2008-07-14 04:02:17 -0400 |
commit | ef60cd13ecee0ccf2439d63013cbfc798aea2bb9 (patch) | |
tree | 1d0dff750b0c031a1476d14a4fc2dd5071a08aaf /drivers/s390/cio/css.c | |
parent | e0bc24958e1305efe176adc9d5f23a09e84c0058 (diff) |
[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 <sebott@linux.vnet.ibm.com>
Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
Diffstat (limited to 'drivers/s390/cio/css.c')
-rw-r--r-- | drivers/s390/cio/css.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/s390/cio/css.c b/drivers/s390/cio/css.c index 4e2f2bbf4ba5..46c021d880dc 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) | |||
164 | void css_sch_device_unregister(struct subchannel *sch) | 164 | void css_sch_device_unregister(struct subchannel *sch) |
165 | { | 165 | { |
166 | mutex_lock(&sch->reg_mutex); | 166 | mutex_lock(&sch->reg_mutex); |
167 | device_unregister(&sch->dev); | 167 | if (device_is_registered(&sch->dev)) |
168 | device_unregister(&sch->dev); | ||
168 | mutex_unlock(&sch->reg_mutex); | 169 | mutex_unlock(&sch->reg_mutex); |
169 | } | 170 | } |
170 | EXPORT_SYMBOL_GPL(css_sch_device_unregister); | 171 | EXPORT_SYMBOL_GPL(css_sch_device_unregister); |