summaryrefslogtreecommitdiff
path: root/drivers/block
diff options
context:
space:
mode:
authorLuis Chamberlain <mcgrof@kernel.org>2021-10-16 02:52:16 +0300
committerJens Axboe <axboe@kernel.dk>2021-10-30 20:03:37 +0300
commitff4cbe0fcf5d749f76040f782f0618656cd23e33 (patch)
tree8e76baa50b5e40f18cf6a5cc6428d7c0dd662dff /drivers/block
parent5e2e1cc4131cf4d21629c94331f2351b7dc8b87c (diff)
downloadlinux-ff4cbe0fcf5d749f76040f782f0618656cd23e33.tar.xz
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>
Diffstat (limited to 'drivers/block')
-rw-r--r--drivers/block/ps3disk.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/drivers/block/ps3disk.c b/drivers/block/ps3disk.c
index 8d51efbe045d..3054adf77460 100644
--- a/drivers/block/ps3disk.c
+++ b/drivers/block/ps3disk.c
@@ -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: