Skip to content

Commit

Permalink
[S390] cio: fix double unregistering of subchannels
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Sebastian Ott authored and Heiko Carstens committed Jul 14, 2008
1 parent e0bc249 commit ef60cd1
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion drivers/s390/cio/css.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit ef60cd1

Please sign in to comment.