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

Commit 50f15483 authored by Sebastian Ott's avatar Sebastian Ott Committed by Martin Schwidefsky
Browse files

[S390] cio: fix sanity checks in ccwgroup driver.



Some sanity checks in the ccw group driver test the output of
container_of macros to be !NULL. Test the input parameters instead.

Signed-off-by: default avatarSebastian Ott <sebott@linux.vnet.ibm.com>
Signed-off-by: default avatarMartin Schwidefsky <schwidefsky@de.ibm.com>
parent 40c9f999
Loading
Loading
Loading
Loading
+12 −4
Original line number Diff line number Diff line
@@ -454,13 +454,17 @@ ccwgroup_remove (struct device *dev)
	struct ccwgroup_device *gdev;
	struct ccwgroup_driver *gdrv;

	device_remove_file(dev, &dev_attr_online);

	if (!dev->driver)
		return 0;

	gdev = to_ccwgroupdev(dev);
	gdrv = to_ccwgroupdrv(dev->driver);

	device_remove_file(dev, &dev_attr_online);

	if (gdrv && gdrv->remove)
	if (gdrv->remove)
		gdrv->remove(gdev);

	return 0;
}

@@ -469,9 +473,13 @@ static void ccwgroup_shutdown(struct device *dev)
	struct ccwgroup_device *gdev;
	struct ccwgroup_driver *gdrv;

	if (!dev->driver)
		return;

	gdev = to_ccwgroupdev(dev);
	gdrv = to_ccwgroupdrv(dev->driver);
	if (gdrv && gdrv->shutdown)

	if (gdrv->shutdown)
		gdrv->shutdown(gdev);
}