提交 05017db3 编写于 作者: B Bartlomiej Zolnierkiewicz

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: NBartlomiej Zolnierkiewicz <bzolnier@gmail.com>
上级 aa5dc8eb
...@@ -3507,15 +3507,8 @@ static int ide_cd_probe(ide_drive_t *drive) ...@@ -3507,15 +3507,8 @@ static int ide_cd_probe(ide_drive_t *drive)
g->driverfs_dev = &drive->gendev; g->driverfs_dev = &drive->gendev;
g->flags = GENHD_FL_CD | GENHD_FL_REMOVABLE; g->flags = GENHD_FL_CD | GENHD_FL_REMOVABLE;
if (ide_cdrom_setup(drive)) { if (ide_cdrom_setup(drive)) {
struct cdrom_device_info *devinfo = &info->devinfo;
ide_proc_unregister_driver(drive, &ide_cdrom_driver); ide_proc_unregister_driver(drive, &ide_cdrom_driver);
kfree(info->buffer); ide_cd_release(&info->kref);
kfree(info->toc);
kfree(info->changer_info);
if (devinfo->handle == drive && unregister_cdrom(devinfo))
printk (KERN_ERR "%s: ide_cdrom_cleanup failed to unregister device from the cdrom driver.\n", drive->name);
kfree(info);
drive->driver_data = NULL;
goto failed; goto failed;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册