[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20210901210028.1750956-2-mcgrof@kernel.org>
Date: Wed, 1 Sep 2021 14:00:19 -0700
From: Luis Chamberlain <mcgrof@...nel.org>
To: axboe@...nel.dk, bhelgaas@...gle.com, liushixin2@...wei.com,
thunder.leizhen@...wei.com, lee.jones@...aro.org,
geoff@...radead.org, mpe@...erman.id.au, benh@...nel.crashing.org,
paulus@...ba.org, jim@...n.com, haris.iqbal@...os.com,
jinpu.wang@...os.com, josh.h.morris@...ibm.com,
pjk1939@...ux.ibm.com, tim@...erelk.net, richard@....at,
miquel.raynal@...tlin.com, vigneshr@...com
Cc: linux-mtd@...ts.infradead.org, linuxppc-dev@...ts.ozlabs.org,
linux-block@...r.kernel.org, linux-kernel@...r.kernel.org,
Luis Chamberlain <mcgrof@...nel.org>
Subject: [PATCH 01/10] mtip32xx: 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.
The read_capacity_error error label already does what we need,
so just re-use that.
Signed-off-by: Luis Chamberlain <mcgrof@...nel.org>
---
drivers/block/mtip32xx/mtip32xx.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/drivers/block/mtip32xx/mtip32xx.c b/drivers/block/mtip32xx/mtip32xx.c
index 901855717cb5..d0b40309f47e 100644
--- a/drivers/block/mtip32xx/mtip32xx.c
+++ b/drivers/block/mtip32xx/mtip32xx.c
@@ -3633,7 +3633,9 @@ static int mtip_block_initialize(struct driver_data *dd)
set_capacity(dd->disk, capacity);
/* Enable the block device and add it to /dev */
- device_add_disk(&dd->pdev->dev, dd->disk, mtip_disk_attr_groups);
+ rv = device_add_disk(&dd->pdev->dev, dd->disk, mtip_disk_attr_groups);
+ if (rv)
+ goto read_capacity_error;
if (dd->mtip_svc_handler) {
set_bit(MTIP_DDF_INIT_DONE_BIT, &dd->dd_flag);
--
2.30.2
Powered by blists - more mailing lists