aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/cxlflash
diff options
context:
space:
mode:
authorChristophe JAILLET <christophe.jaillet@wanadoo.fr>2017-08-15 22:18:14 +0200
committerMartin K. Petersen <martin.petersen@oracle.com>2017-08-24 22:28:54 -0400
commit9ff870417e56b1fb7b15b2cda74de639d3cd8559 (patch)
tree96351f472c13f733bf6313478ee897fdd42a0d6b /drivers/scsi/cxlflash
parentscsi: sym53c8xx: Avoid undefined behaviour (diff)
downloadlinux-dev-9ff870417e56b1fb7b15b2cda74de639d3cd8559.tar.xz
linux-dev-9ff870417e56b1fb7b15b2cda74de639d3cd8559.zip
scsi: cxlflash: Fix an error handling path in 'cxlflash_disk_attach()'
'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>
Diffstat (limited to 'drivers/scsi/cxlflash')
-rw-r--r--drivers/scsi/cxlflash/superpipe.c1
1 files changed, 1 insertions, 0 deletions
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;
}