[SCSI] sr: fix error handling in module_init
Sweep registered blkdev when scsi_register_driver has failed. Cc: Jens Axboe <jens.axboe@oracle.com> Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com> Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
This commit is contained in:
Родитель
a57850379e
Коммит
da3962fe63
|
@ -885,7 +885,11 @@ static int __init init_sr(void)
|
|||
rc = register_blkdev(SCSI_CDROM_MAJOR, "sr");
|
||||
if (rc)
|
||||
return rc;
|
||||
return scsi_register_driver(&sr_template.gendrv);
|
||||
rc = scsi_register_driver(&sr_template.gendrv);
|
||||
if (rc)
|
||||
unregister_blkdev(SCSI_CDROM_MAJOR, "sr");
|
||||
|
||||
return rc;
|
||||
}
|
||||
|
||||
static void __exit exit_sr(void)
|
||||
|
|
Загрузка…
Ссылка в новой задаче