summaryrefslogtreecommitdiff
path: root/drivers/block/aoe
diff options
context:
space:
mode:
authorLuis Chamberlain <mcgrof@kernel.org>2021-09-28 01:00:57 +0300
committerJens Axboe <axboe@kernel.dk>2021-10-18 23:41:36 +0300
commitd9c2bd252a4578419e0b863bfe3dd97b858ccd8e (patch)
tree0848c88a9516be8fe29c82ee2c2ee32fdf665146 /drivers/block/aoe
parente1654f413fe08ffbc3292d8d2b8958b2cc5cb5e8 (diff)
downloadlinux-d9c2bd252a4578419e0b863bfe3dd97b858ccd8e.tar.xz
aoe: 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> Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'drivers/block/aoe')
-rw-r--r--drivers/block/aoe/aoeblk.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/drivers/block/aoe/aoeblk.c b/drivers/block/aoe/aoeblk.c
index 06b360f7123a..e436b0e8eff5 100644
--- a/drivers/block/aoe/aoeblk.c
+++ b/drivers/block/aoe/aoeblk.c
@@ -417,7 +417,9 @@ aoeblk_gdalloc(void *vp)
spin_unlock_irqrestore(&d->lock, flags);
- device_add_disk(NULL, gd, aoe_attr_groups);
+ err = device_add_disk(NULL, gd, aoe_attr_groups);
+ if (err)
+ goto out_disk_cleanup;
aoedisk_add_debugfs(d);
spin_lock_irqsave(&d->lock, flags);
@@ -426,6 +428,8 @@ aoeblk_gdalloc(void *vp)
spin_unlock_irqrestore(&d->lock, flags);
return;
+out_disk_cleanup:
+ blk_cleanup_disk(gd);
err_tagset:
blk_mq_free_tag_set(set);
err_mempool: