diff options
author | Sebastian Ott <sebott@linux.vnet.ibm.com> | 2009-03-26 10:24:14 -0400 |
---|---|---|
committer | Martin Schwidefsky <schwidefsky@de.ibm.com> | 2009-03-26 10:24:15 -0400 |
commit | 50f1548399b7bd00ceb38c84a84463a89c82afe8 (patch) | |
tree | c1d334bb49b1fc9cbeef9761dea1eb8ec979e4f8 | |
parent | 40c9f9992bc1caa1bb890bd8163361dbf2eefa86 (diff) |
[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: Sebastian Ott <sebott@linux.vnet.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
-rw-r--r-- | drivers/s390/cio/ccwgroup.c | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/drivers/s390/cio/ccwgroup.c b/drivers/s390/cio/ccwgroup.c index ec2742813bf2..2becedbe8883 100644 --- a/drivers/s390/cio/ccwgroup.c +++ b/drivers/s390/cio/ccwgroup.c | |||
@@ -454,13 +454,17 @@ ccwgroup_remove (struct device *dev) | |||
454 | struct ccwgroup_device *gdev; | 454 | struct ccwgroup_device *gdev; |
455 | struct ccwgroup_driver *gdrv; | 455 | struct ccwgroup_driver *gdrv; |
456 | 456 | ||
457 | device_remove_file(dev, &dev_attr_online); | ||
458 | |||
459 | if (!dev->driver) | ||
460 | return 0; | ||
461 | |||
457 | gdev = to_ccwgroupdev(dev); | 462 | gdev = to_ccwgroupdev(dev); |
458 | gdrv = to_ccwgroupdrv(dev->driver); | 463 | gdrv = to_ccwgroupdrv(dev->driver); |
459 | 464 | ||
460 | device_remove_file(dev, &dev_attr_online); | 465 | if (gdrv->remove) |
461 | |||
462 | if (gdrv && gdrv->remove) | ||
463 | gdrv->remove(gdev); | 466 | gdrv->remove(gdev); |
467 | |||
464 | return 0; | 468 | return 0; |
465 | } | 469 | } |
466 | 470 | ||
@@ -469,9 +473,13 @@ static void ccwgroup_shutdown(struct device *dev) | |||
469 | struct ccwgroup_device *gdev; | 473 | struct ccwgroup_device *gdev; |
470 | struct ccwgroup_driver *gdrv; | 474 | struct ccwgroup_driver *gdrv; |
471 | 475 | ||
476 | if (!dev->driver) | ||
477 | return; | ||
478 | |||
472 | gdev = to_ccwgroupdev(dev); | 479 | gdev = to_ccwgroupdev(dev); |
473 | gdrv = to_ccwgroupdrv(dev->driver); | 480 | gdrv = to_ccwgroupdrv(dev->driver); |
474 | if (gdrv && gdrv->shutdown) | 481 | |
482 | if (gdrv->shutdown) | ||
475 | gdrv->shutdown(gdev); | 483 | gdrv->shutdown(gdev); |
476 | } | 484 | } |
477 | 485 | ||