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

Commit 1a908c73 authored by Cornelia Huck's avatar Cornelia Huck Committed by Martin Schwidefsky
Browse files

[S390] cio: Fix ungroup vs. machine check race in ccwgroup.



There are two ways for a ccwgroup device to be unregistered:
Via the ungroup attribute, or when on of the slave devices is killed
by a machine check. As we have to unregister the ccwgroup device
via a callback, we'll now have to check whether it hasn't been
already unregistered because of a machine check.

Signed-off-by: default avatarCornelia Huck <cornelia.huck@de.ibm.com>
Signed-off-by: default avatarMartin Schwidefsky <schwidefsky@de.ibm.com>
parent 46258ab5
Loading
Loading
Loading
Loading
+4 −2
Original line number Diff line number Diff line
@@ -75,8 +75,10 @@ static void ccwgroup_ungroup_callback(struct device *dev)
	struct ccwgroup_device *gdev = to_ccwgroupdev(dev);

	mutex_lock(&gdev->reg_mutex);
	if (device_is_registered(&gdev->dev)) {
		__ccwgroup_remove_symlinks(gdev);
		device_unregister(dev);
	}
	mutex_unlock(&gdev->reg_mutex);
}