Skip to content

Commit

Permalink
pktcdvd: add error handling support for add_disk()
Browse files Browse the repository at this point in the history
We never checked for errors on add_disk() as this function
returned void. Now that this is fixed, use the shiny new
error handling.

The out_mem2 error label already does what we need so
re-use that.

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 4a32e1c commit 7b50562
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion drivers/block/pktcdvd.c
Original file line number Diff line number Diff line change
Expand Up @@ -2728,7 +2728,9 @@ static int pkt_setup_dev(dev_t dev, dev_t* pkt_dev)
/* inherit events of the host device */
disk->events = pd->bdev->bd_disk->events;

add_disk(disk);
ret = add_disk(disk);
if (ret)
goto out_mem2;

pkt_sysfs_dev_new(pd);
pkt_debugfs_dev_new(pd);
Expand Down

0 comments on commit 7b50562

Please sign in to comment.