Commit 4dfbd139 authored by Luis Chamberlain's avatar Luis Chamberlain Committed by Jens Axboe

pcd: add error handling support for add_disk()

We never checked for errors on add_disk() as this function
returned void. Now that this is fixed, use the shiny new
error handling.
Signed-off-by: default avatarLuis Chamberlain <mcgrof@kernel.org>
Signed-off-by: default avatarJens Axboe <axboe@kernel.dk>
parent 1ad392ad
......@@ -941,9 +941,13 @@ 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);
add_disk(cd->disk);
ret = add_disk(cd->disk);
if (ret)
goto out_unreg_cdrom;
return 0;
out_unreg_cdrom:
unregister_cdrom(&cd->info);
out_pi_release:
pi_release(cd->pi);
out_free_disk:
......
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