summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLuis Chamberlain <mcgrof@kernel.org>2021-09-27 15:01:09 -0700
committerJens Axboe <axboe@kernel.dk>2021-10-18 14:41:36 -0600
commitb6fa069971bc427e19b8f3882a808f24530994ed (patch)
treed454e6e2b0bf4ee35ac36dac38621a00e2e6ac08
parent2b6cabce3954be3341e0fe7b20a27902821fd3dd (diff)
downloadlinux-stable-b6fa069971bc427e19b8f3882a808f24530994ed.tar.gz
linux-stable-b6fa069971bc427e19b8f3882a808f24530994ed.tar.bz2
linux-stable-b6fa069971bc427e19b8f3882a808f24530994ed.zip
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: Luis Chamberlain <mcgrof@kernel.org> Signed-off-by: Jens Axboe <axboe@kernel.dk>
-rw-r--r--drivers/block/paride/pcd.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/block/paride/pcd.c b/drivers/block/paride/pcd.c
index 82a654fc4db8..4cc0d141db78 100644
--- a/drivers/block/paride/pcd.c
+++ b/drivers/block/paride/pcd.c
@@ -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;