Blob Blame History Raw
From 9ff870417e56b1fb7b15b2cda74de639d3cd8559 Mon Sep 17 00:00:00 2001
From: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Date: Tue, 15 Aug 2017 22:18:14 +0200
Subject: [PATCH] scsi: cxlflash: Fix an error handling path in
 'cxlflash_disk_attach()'

References: fate#322239
Git-repo: https://git.kernel.org/pub/scm/linux/kernel/git/mkp/scsi.git
Patch-mainline: queued
Git-commit: 9ff870417e56b1fb7b15b2cda74de639d3cd8559

'rc' is known to be 0 at this point.  If 'create_context()' fails,
returns -ENOMEM instead of 0 which means success.

Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Acked-by: Matthew R. Ochs <mrochs@linux.vnet.ibm.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Acked-by: Michal Suchanek <msuchanek@suse.de>
---
 drivers/scsi/cxlflash/superpipe.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/scsi/cxlflash/superpipe.c b/drivers/scsi/cxlflash/superpipe.c
index ad0f9968ccfb..08da593cb2f6 100644
--- a/drivers/scsi/cxlflash/superpipe.c
+++ b/drivers/scsi/cxlflash/superpipe.c
@@ -1390,6 +1390,7 @@ static int cxlflash_disk_attach(struct scsi_device *sdev,
 	if (unlikely(!ctxi)) {
 		dev_err(dev, "%s: Failed to create context ctxid=%d\n",
 			__func__, ctxid);
+		rc = -ENOMEM;
 		goto err;
 	}
 
-- 
2.10.2