diff options
author | Jesper Juhl <jesper.juhl@gmail.com> | 2005-11-07 04:01:32 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2005-11-07 10:54:05 -0500 |
commit | 6044ec8882c726e325017bd948aa0cd94ad33abc (patch) | |
tree | 3bfc5dc93434e8ad556540f6689abcd2699aa45d /drivers/ide/ide-cd.c | |
parent | 2ea7533060e361810c21b2f5ee02151c4dfb85d8 (diff) |
[PATCH] kfree cleanup: misc remaining drivers
This is the remaining misc drivers/ part of the big kfree cleanup patch.
Remove pointless checks for NULL prior to calling kfree() in misc files in
drivers/.
Signed-off-by: Jesper Juhl <jesper.juhl@gmail.com>
Acked-by: Aristeu Sergio Rozanski Filho <aris@cathedrallabs.org>
Acked-by: Roland Dreier <rolandd@cisco.com>
Acked-by: Pierre Ossman <drzeus@drzeus.cx>
Acked-by: Jean Delvare <khali@linux-fr.org>
Acked-by: Greg Kroah-Hartman <gregkh@suse.de>
Acked-by: Len Brown <len.brown@intel.com>
Acked-by: "Antonino A. Daplas" <adaplas@gmail.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'drivers/ide/ide-cd.c')
-rw-r--r-- | drivers/ide/ide-cd.c | 18 |
1 files changed, 6 insertions, 12 deletions
diff --git a/drivers/ide/ide-cd.c b/drivers/ide/ide-cd.c index 74d2ab0d901e..c2f47923d174 100644 --- a/drivers/ide/ide-cd.c +++ b/drivers/ide/ide-cd.c | |||
@@ -3292,12 +3292,9 @@ static void ide_cd_release(struct kref *kref) | |||
3292 | ide_drive_t *drive = info->drive; | 3292 | ide_drive_t *drive = info->drive; |
3293 | struct gendisk *g = info->disk; | 3293 | struct gendisk *g = info->disk; |
3294 | 3294 | ||
3295 | if (info->buffer != NULL) | 3295 | kfree(info->buffer); |
3296 | kfree(info->buffer); | 3296 | kfree(info->toc); |
3297 | if (info->toc != NULL) | 3297 | kfree(info->changer_info); |
3298 | kfree(info->toc); | ||
3299 | if (info->changer_info != NULL) | ||
3300 | kfree(info->changer_info); | ||
3301 | if (devinfo->handle == drive && unregister_cdrom(devinfo)) | 3298 | if (devinfo->handle == drive && unregister_cdrom(devinfo)) |
3302 | printk(KERN_ERR "%s: %s failed to unregister device from the cdrom " | 3299 | printk(KERN_ERR "%s: %s failed to unregister device from the cdrom " |
3303 | "driver.\n", __FUNCTION__, drive->name); | 3300 | "driver.\n", __FUNCTION__, drive->name); |
@@ -3487,12 +3484,9 @@ static int ide_cd_probe(struct device *dev) | |||
3487 | if (ide_cdrom_setup(drive)) { | 3484 | if (ide_cdrom_setup(drive)) { |
3488 | struct cdrom_device_info *devinfo = &info->devinfo; | 3485 | struct cdrom_device_info *devinfo = &info->devinfo; |
3489 | ide_unregister_subdriver(drive, &ide_cdrom_driver); | 3486 | ide_unregister_subdriver(drive, &ide_cdrom_driver); |
3490 | if (info->buffer != NULL) | 3487 | kfree(info->buffer); |
3491 | kfree(info->buffer); | 3488 | kfree(info->toc); |
3492 | if (info->toc != NULL) | 3489 | kfree(info->changer_info); |
3493 | kfree(info->toc); | ||
3494 | if (info->changer_info != NULL) | ||
3495 | kfree(info->changer_info); | ||
3496 | if (devinfo->handle == drive && unregister_cdrom(devinfo)) | 3490 | if (devinfo->handle == drive && unregister_cdrom(devinfo)) |
3497 | printk (KERN_ERR "%s: ide_cdrom_cleanup failed to unregister device from the cdrom driver.\n", drive->name); | 3491 | printk (KERN_ERR "%s: ide_cdrom_cleanup failed to unregister device from the cdrom driver.\n", drive->name); |
3498 | kfree(info); | 3492 | kfree(info); |