Skip to content

Commit

Permalink
pd: 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.

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 b6fa069 commit 3dfdd5f
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion drivers/block/paride/pd.c
Original file line number Diff line number Diff line change
Expand Up @@ -938,8 +938,12 @@ static int pd_probe_drive(struct pd_unit *disk, int autoprobe, int port,
if (ret)
goto put_disk;
set_capacity(disk->gd, disk->capacity);
add_disk(disk->gd);
ret = add_disk(disk->gd);
if (ret)
goto cleanup_disk;
return 0;
cleanup_disk:
blk_cleanup_disk(disk->gd);
put_disk:
put_disk(p);
disk->gd = NULL;
Expand Down

0 comments on commit 3dfdd5f

Please sign in to comment.