From: Luis Chamberlain <mcgrof@kernel.org>
To: axboe@kernel.dk, gregkh@linuxfoundation.org,
chaitanya.kulkarni@wdc.com, atulgopinathan@gmail.com,
hare@suse.de, maximlevitsky@gmail.com, oakad@yahoo.com,
ulf.hansson@linaro.org, colin.king@canonical.com,
shubhankarvk@gmail.com, baijiaju1990@gmail.com, trix@redhat.com,
dongsheng.yang@easystack.cn, ceph-devel@vger.kernel.org,
miquel.raynal@bootlin.com, richard@nod.at, vigneshr@ti.com,
sth@linux.ibm.com, hoeppner@linux.ibm.com, hca@linux.ibm.com,
gor@linux.ibm.com, borntraeger@de.ibm.com, oberpar@linux.ibm.com,
tj@kernel.org
Cc: linux-s390@vger.kernel.org, linux-mtd@lists.infradead.org,
linux-mmc@vger.kernel.org, linux-block@vger.kernel.org,
linux-kernel@vger.kernel.org,
Luis Chamberlain <mcgrof@kernel.org>
Subject: [PATCH v2 6/6] s390/block/scm_blk: add error handling support for add_disk()
Date: Mon, 27 Sep 2021 15:02:32 -0700 [thread overview]
Message-ID: <20210927220232.1071926-7-mcgrof@kernel.org> (raw)
In-Reply-To: <20210927220232.1071926-1-mcgrof@kernel.org>
We never checked for errors on add_disk() as this function
returned void. Now that this is fixed, use the shiny new
error handling.
Acked-by: Heiko Carstens <hca@linux.ibm.com>
Signed-off-by: Luis Chamberlain <mcgrof@kernel.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
next prev parent reply other threads:[~2021-09-27 22:04 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-09-27 22:02 [PATCH v2 0/6] block: 5th batch of add_disk() error handling conversions Luis Chamberlain
2021-09-27 22:02 ` [PATCH v2 1/6] cdrom/gdrom: add error handling support for add_disk() Luis Chamberlain
2021-09-27 22:02 ` [PATCH v2 2/6] rbd: add add_disk() error handling Luis Chamberlain
2021-09-27 22:02 ` [PATCH v2 3/6] mtd: " Luis Chamberlain
2021-09-27 22:02 ` [PATCH v2 4/6] s390/block/dasd_genhd: add error handling support for add_disk() Luis Chamberlain
2021-09-27 22:02 ` [PATCH v2 5/6] s390/block/dcssblk: " Luis Chamberlain
2021-09-27 22:02 ` Luis Chamberlain [this message]
2021-09-27 22:32 ` [PATCH v2 0/6] block: 5th batch of add_disk() error handling conversions Jens Axboe
2021-09-28 8:44 ` Heiko Carstens
2021-09-28 12:28 ` Jens Axboe
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20210927220232.1071926-7-mcgrof@kernel.org \
--to=mcgrof@kernel.org \
--cc=atulgopinathan@gmail.com \
--cc=axboe@kernel.dk \
--cc=baijiaju1990@gmail.com \
--cc=borntraeger@de.ibm.com \
--cc=ceph-devel@vger.kernel.org \
--cc=chaitanya.kulkarni@wdc.com \
--cc=colin.king@canonical.com \
--cc=dongsheng.yang@easystack.cn \
--cc=gor@linux.ibm.com \
--cc=gregkh@linuxfoundation.org \
--cc=hare@suse.de \
--cc=hca@linux.ibm.com \
--cc=hoeppner@linux.ibm.com \
--cc=linux-block@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mmc@vger.kernel.org \
--cc=linux-mtd@lists.infradead.org \
--cc=linux-s390@vger.kernel.org \
--cc=maximlevitsky@gmail.com \
--cc=miquel.raynal@bootlin.com \
--cc=oakad@yahoo.com \
--cc=oberpar@linux.ibm.com \
--cc=richard@nod.at \
--cc=shubhankarvk@gmail.com \
--cc=sth@linux.ibm.com \
--cc=tj@kernel.org \
--cc=trix@redhat.com \
--cc=ulf.hansson@linaro.org \
--cc=vigneshr@ti.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).