diff options
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); |