Commit b6fa0699 authored by Luis Chamberlain's avatar Luis Chamberlain Committed by Jens Axboe

pcd: capture errors on cdrom_register()

No errors were being captured wehen cdrom_register() fails,
capture the error and return the error.
Signed-off-by: default avatarLuis Chamberlain <mcgrof@kernel.org>
Signed-off-by: default avatarJens Axboe <axboe@kernel.dk>
parent 2b6cabce
......@@ -940,7 +940,9 @@ static int pcd_init_unit(struct pcd_unit *cd, bool autoprobe, int port,
cd->present = 1;
pcd_probe_capabilities(cd);
register_cdrom(cd->disk, &cd->info);
ret = register_cdrom(cd->disk, &cd->info);
if (ret)
goto out_pi_release;
ret = add_disk(cd->disk);
if (ret)
goto out_unreg_cdrom;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment