From: Cornelia Huck Date: Sat, 26 Jan 2008 13:10:50 +0000 (+0100) Subject: [S390] cio: Fix ungroup vs. machine check race in ccwgroup. X-Git-Tag: v2.6.25-rc1~1228^2~41 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=1a908c735aed44c8bbed303371202e416813b271;p=platform%2Fkernel%2Flinux-exynos.git [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: Cornelia Huck Signed-off-by: Martin Schwidefsky --- diff --git a/drivers/s390/cio/ccwgroup.c b/drivers/s390/cio/ccwgroup.c index dc1c5f4..3964056 100644 --- a/drivers/s390/cio/ccwgroup.c +++ b/drivers/s390/cio/ccwgroup.c @@ -75,8 +75,10 @@ static void ccwgroup_ungroup_callback(struct device *dev) struct ccwgroup_device *gdev = to_ccwgroupdev(dev); mutex_lock(&gdev->reg_mutex); - __ccwgroup_remove_symlinks(gdev); - device_unregister(dev); + if (device_is_registered(&gdev->dev)) { + __ccwgroup_remove_symlinks(gdev); + device_unregister(dev); + } mutex_unlock(&gdev->reg_mutex); }