[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20210830221000.179369-3-mcgrof@kernel.org>
Date: Mon, 30 Aug 2021 15:09:47 -0700
From: Luis Chamberlain <mcgrof@...nel.org>
To: axboe@...nel.dk, justin@...aid.com, geert@...ux-m68k.org,
ulf.hansson@...aro.org, hare@...e.de, tj@...nel.org,
philipp.reisner@...bit.com, lars.ellenberg@...bit.com,
jdike@...toit.com, richard@....at, anton.ivanov@...bridgegreys.com,
johannes.berg@...el.com, chris.obbard@...labora.com,
krisman@...labora.com, zhuyifei1999@...il.com, thehajime@...il.com,
chris@...kel.net, jcmvbkbc@...il.com, tim@...erelk.net
Cc: linux-xtensa@...ux-xtensa.org, linux-um@...ts.infradead.org,
linux-m68k@...ts.linux-m68k.org, drbd-dev@...ts.linbit.com,
linux-block@...r.kernel.org, linux-kernel@...r.kernel.org,
Luis Chamberlain <mcgrof@...nel.org>
Subject: [PATCH 02/15] 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@...nel.org>
---
drivers/block/aoe/aoeblk.c | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
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:
--
2.30.2
Powered by blists - more mailing lists