diff mbox

[-next] scsi: ibmvscsis: Fix error return code in ibmvscsis_probe()

Message ID 1473909923-30014-1-git-send-email-weiyj.lk@gmail.com (mailing list archive)
State Accepted, archived
Headers show

Commit Message

Wei Yongjun Sept. 15, 2016, 3:25 a.m. UTC
From: Wei Yongjun <weiyongjun1@huawei.com>

Fix to return error code -ENOMEM from the dma mapping error handling
case instead of 0, as done elsewhere in this function.

Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
---
 drivers/scsi/ibmvscsi_tgt/ibmvscsi_tgt.c | 1 +
 1 file changed, 1 insertion(+)


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

Comments

Johannes Thumshirn Sept. 15, 2016, 6:24 a.m. UTC | #1
On Thu, Sep 15, 2016 at 03:25:23AM +0000, Wei Yongjun wrote:
> From: Wei Yongjun <weiyongjun1@huawei.com>
> 
> Fix to return error code -ENOMEM from the dma mapping error handling
> case instead of 0, as done elsewhere in this function.
> 
> Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
> ---

Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de>
Martin K. Petersen Sept. 15, 2016, 1:57 p.m. UTC | #2
>>>>> "Wei" == Wei Yongjun <weiyj.lk@gmail.com> writes:

Wei> From: Wei Yongjun <weiyongjun1@huawei.com> Fix to return error code
Wei> -ENOMEM from the dma mapping error handling case instead of 0, as
Wei> done elsewhere in this function.

Applied to 4.9/scsi-queue.
diff mbox

Patch

diff --git a/drivers/scsi/ibmvscsi_tgt/ibmvscsi_tgt.c b/drivers/scsi/ibmvscsi_tgt/ibmvscsi_tgt.c
index 4dd8e5e..38b086e 100644
--- a/drivers/scsi/ibmvscsi_tgt/ibmvscsi_tgt.c
+++ b/drivers/scsi/ibmvscsi_tgt/ibmvscsi_tgt.c
@@ -3449,6 +3449,7 @@  static int ibmvscsis_probe(struct vio_dev *vdev,
 	vscsi->map_ioba = dma_map_single(&vdev->dev, vscsi->map_buf, PAGE_SIZE,
 					 DMA_BIDIRECTIONAL);
 	if (dma_mapping_error(&vdev->dev, vscsi->map_ioba)) {
+		rc = -ENOMEM;
 		dev_err(&vscsi->dev, "probe: error mapping command buffer\n");
 		goto free_buf;
 	}