Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit ef60cd13 authored by Sebastian Ott's avatar Sebastian Ott Committed by Heiko Carstens
Browse files

[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: default avatarSebastian Ott <sebott@linux.vnet.ibm.com>
Signed-off-by: default avatarHeiko Carstens <heiko.carstens@de.ibm.com>
Signed-off-by: default avatarMartin Schwidefsky <schwidefsky@de.ibm.com>
parent e0bc2495
Loading
Loading
Loading
Loading
+2 −1
Original line number Original line Diff line number Diff line
@@ -164,6 +164,7 @@ static int css_sch_device_register(struct subchannel *sch)
void css_sch_device_unregister(struct subchannel *sch)
void css_sch_device_unregister(struct subchannel *sch)
{
{
	mutex_lock(&sch->reg_mutex);
	mutex_lock(&sch->reg_mutex);
	if (device_is_registered(&sch->dev))
		device_unregister(&sch->dev);
		device_unregister(&sch->dev);
	mutex_unlock(&sch->reg_mutex);
	mutex_unlock(&sch->reg_mutex);
}
}