[PATCH -next] s390/scm_block: fix error return code in scm_blk_dev_setup()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Wei Yongjun <weiyongjun1@xxxxxxxxxx>

Fix to return a negative error code from the error handling
case instead of 0, as done elsewhere in this function.

Fixes: 9cec5926ea07 ("s390/scm: convert to blk-mq")
Signed-off-by: Wei Yongjun <weiyongjun1@xxxxxxxxxx>
---
 drivers/s390/block/scm_blk.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/drivers/s390/block/scm_blk.c b/drivers/s390/block/scm_blk.c
index 71c0158..b1ffe5a 100644
--- a/drivers/s390/block/scm_blk.c
+++ b/drivers/s390/block/scm_blk.c
@@ -457,8 +457,10 @@ int scm_blk_dev_setup(struct scm_blk_dev *bdev, struct scm_device *scmdev)
 		goto out;
 
 	rq = blk_mq_init_queue(&bdev->tag_set);
-	if (IS_ERR(rq))
+	if (IS_ERR(rq)) {
+		ret = PTR_ERR(rq);
 		goto out_tag;
+	}
 
 	bdev->rq = rq;
 	nr_max_blk = min(scmdev->nr_max_block,
@@ -471,8 +473,10 @@ int scm_blk_dev_setup(struct scm_blk_dev *bdev, struct scm_device *scmdev)
 	queue_flag_clear_unlocked(QUEUE_FLAG_ADD_RANDOM, rq);
 
 	bdev->gendisk = alloc_disk(SCM_NR_PARTS);
-	if (!bdev->gendisk)
+	if (!bdev->gendisk) {
+		ret = -ENOMEM;
 		goto out_queue;
+	}
 
 	rq->queuedata = scmdev;
 	bdev->gendisk->private_data = scmdev;

--
To unsubscribe from this list: send the line "unsubscribe linux-s390" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Kernel Development]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite Info]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Linux Media]     [Device Mapper]

  Powered by Linux