Skip to content

Commit

Permalink
null_blk: 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 actual cleanup in case of error is
already handled by the caller of null_gendisk_register().

Signed-off-by: Luis Chamberlain <mcgrof@kernel.org>
  • Loading branch information
mcgrof authored and intel-lab-lkp committed Jul 15, 2021
1 parent bc7835f commit df9eb8c
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions drivers/block/null_blk/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -1721,8 +1721,7 @@ static int null_gendisk_register(struct nullb *nullb)
return ret;
}

add_disk(disk);
return 0;
return add_disk(disk);
}

static int null_init_tag_set(struct nullb *nullb, struct blk_mq_tag_set *set)
Expand Down

0 comments on commit df9eb8c

Please sign in to comment.