Skip to content

Commit

Permalink
pcd: capture errors on cdrom_register()
Browse files Browse the repository at this point in the history
No errors were being captured wehen cdrom_register() fails,
capture the error and return the error.

Signed-off-by: Luis Chamberlain <mcgrof@kernel.org>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
  • Loading branch information
Luis Chamberlain authored and Jens Axboe committed Oct 18, 2021
1 parent 2b6cabc commit b6fa069
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion drivers/block/paride/pcd.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit b6fa069

Please sign in to comment.