[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20210902174105.2418771-9-mcgrof@kernel.org>
Date: Thu, 2 Sep 2021 10:41:04 -0700
From: Luis Chamberlain <mcgrof@...nel.org>
To: axboe@...nel.dk, gregkh@...uxfoundation.org,
chaitanya.kulkarni@....com, atulgopinathan@...il.com, hare@...e.de,
maximlevitsky@...il.com, oakad@...oo.com, ulf.hansson@...aro.org,
colin.king@...onical.com, shubhankarvk@...il.com,
baijiaju1990@...il.com, trix@...hat.com,
dongsheng.yang@...ystack.cn, ceph-devel@...r.kernel.org,
miquel.raynal@...tlin.com, richard@....at, vigneshr@...com,
sth@...ux.ibm.com, hoeppner@...ux.ibm.com, hca@...ux.ibm.com,
gor@...ux.ibm.com, borntraeger@...ibm.com, oberpar@...ux.ibm.com,
tj@...nel.org
Cc: linux-s390@...r.kernel.org, linux-mtd@...ts.infradead.org,
linux-mmc@...r.kernel.org, linux-block@...r.kernel.org,
linux-kernel@...r.kernel.org, Luis Chamberlain <mcgrof@...nel.org>
Subject: [PATCH 8/9] s390/block/scm_blk: 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/s390/block/scm_blk.c | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/drivers/s390/block/scm_blk.c b/drivers/s390/block/scm_blk.c
index 88cba6212ee2..61ecdcb2cc6a 100644
--- a/drivers/s390/block/scm_blk.c
+++ b/drivers/s390/block/scm_blk.c
@@ -495,9 +495,14 @@ int scm_blk_dev_setup(struct scm_blk_dev *bdev, struct scm_device *scmdev)
/* 512 byte sectors */
set_capacity(bdev->gendisk, scmdev->size >> 9);
- device_add_disk(&scmdev->dev, bdev->gendisk, NULL);
+ ret = device_add_disk(&scmdev->dev, bdev->gendisk, NULL);
+ if (ret)
+ goto out_cleanup_disk;
+
return 0;
+out_cleanup_disk:
+ blk_cleanup_disk(bdev->gendisk);
out_tag:
blk_mq_free_tag_set(&bdev->tag_set);
out:
--
2.30.2
Powered by blists - more mailing lists