mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2025-01-19 12:24:34 +08:00
ps3disk: 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: Luis Chamberlain <mcgrof@kernel.org> Tested-by: Geoff Levand <geoff@infradead.org> Link: https://lore.kernel.org/r/20211015235219.2191207-11-mcgrof@kernel.org Signed-off-by: Jens Axboe <axboe@kernel.dk>
This commit is contained in:
parent
5e2e1cc413
commit
ff4cbe0fcf
@ -467,9 +467,13 @@ static int ps3disk_probe(struct ps3_system_bus_device *_dev)
|
||||
gendisk->disk_name, priv->model, priv->raw_capacity >> 11,
|
||||
get_capacity(gendisk) >> 11);
|
||||
|
||||
device_add_disk(&dev->sbd.core, gendisk, NULL);
|
||||
return 0;
|
||||
error = device_add_disk(&dev->sbd.core, gendisk, NULL);
|
||||
if (error)
|
||||
goto fail_cleanup_disk;
|
||||
|
||||
return 0;
|
||||
fail_cleanup_disk:
|
||||
blk_cleanup_disk(gendisk);
|
||||
fail_free_tag_set:
|
||||
blk_mq_free_tag_set(&priv->tag_set);
|
||||
fail_teardown:
|
||||
|
Loading…
Reference in New Issue
Block a user