diff options
author | Bartlomiej Zolnierkiewicz <bzolnier@gmail.com> | 2007-12-24 09:23:43 -0500 |
---|---|---|
committer | Bartlomiej Zolnierkiewicz <bzolnier@gmail.com> | 2007-12-24 09:23:43 -0500 |
commit | 05017db3b3e0f0a294a38c38d7adb7d2c0c9844b (patch) | |
tree | 2102a110659301020338469fc2886ae6f1371d0b | |
parent | aa5dc8ebd9ef7521461b1b47ec918be841a21313 (diff) |
ide-cd: use ide_cd_release() in ide_cd_probe()
Use ide_cd_release() to do the cleanup if ide_cdrom_setup() fails.
It fixes:
- the default drive->dsc_overlap value not being restored
- the default drive->queue's prep_rq_fn not being restored
- struct gendisk 'g' not being freed
- wrong function name being reported on unregister_cdrom() error
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
-rw-r--r-- | drivers/ide/ide-cd.c | 9 |
1 files changed, 1 insertions, 8 deletions
diff --git a/drivers/ide/ide-cd.c b/drivers/ide/ide-cd.c index 97ce584fde79..599bb5494251 100644 --- a/drivers/ide/ide-cd.c +++ b/drivers/ide/ide-cd.c | |||
@@ -3507,15 +3507,8 @@ static int ide_cd_probe(ide_drive_t *drive) | |||
3507 | g->driverfs_dev = &drive->gendev; | 3507 | g->driverfs_dev = &drive->gendev; |
3508 | g->flags = GENHD_FL_CD | GENHD_FL_REMOVABLE; | 3508 | g->flags = GENHD_FL_CD | GENHD_FL_REMOVABLE; |
3509 | if (ide_cdrom_setup(drive)) { | 3509 | if (ide_cdrom_setup(drive)) { |
3510 | struct cdrom_device_info *devinfo = &info->devinfo; | ||
3511 | ide_proc_unregister_driver(drive, &ide_cdrom_driver); | 3510 | ide_proc_unregister_driver(drive, &ide_cdrom_driver); |
3512 | kfree(info->buffer); | 3511 | ide_cd_release(&info->kref); |
3513 | kfree(info->toc); | ||
3514 | kfree(info->changer_info); | ||
3515 | if (devinfo->handle == drive && unregister_cdrom(devinfo)) | ||
3516 | printk (KERN_ERR "%s: ide_cdrom_cleanup failed to unregister device from the cdrom driver.\n", drive->name); | ||
3517 | kfree(info); | ||
3518 | drive->driver_data = NULL; | ||
3519 | goto failed; | 3512 | goto failed; |
3520 | } | 3513 | } |
3521 | 3514 | ||