summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWei Yongjun <weiyongjun1@huawei.com>2020-04-28 14:18:55 +0000
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2020-10-01 13:14:45 +0200
commit6909507e9e98b9eed3ce9d6b4d7528aed106d0fb (patch)
treec6c455740a98d33a13a4078d9fe7c03e92f31c63
parentd4a74f4399ccff99a69ff62b0b27d04f5c51aef9 (diff)
downloadlinux-stable-6909507e9e98b9eed3ce9d6b4d7528aed106d0fb.tar.gz
linux-stable-6909507e9e98b9eed3ce9d6b4d7528aed106d0fb.tar.bz2
linux-stable-6909507e9e98b9eed3ce9d6b4d7528aed106d0fb.zip
scsi: cxlflash: Fix error return code in cxlflash_probe()
[ Upstream commit d0b1e4a638d670a09f42017a3e567dc846931ba8 ] Fix to return negative error code -ENOMEM from create_afu error handling case instead of 0, as done elsewhere in this function. Link: https://lore.kernel.org/r/20200428141855.88704-1-weiyongjun1@huawei.com Acked-by: Matthew R. Ochs <mrochs@linux.ibm.com> Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com> Signed-off-by: Sasha Levin <sashal@kernel.org>
-rw-r--r--drivers/scsi/cxlflash/main.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/scsi/cxlflash/main.c b/drivers/scsi/cxlflash/main.c
index f987c40c47a1..443813feaef4 100644
--- a/drivers/scsi/cxlflash/main.c
+++ b/drivers/scsi/cxlflash/main.c
@@ -3749,6 +3749,7 @@ static int cxlflash_probe(struct pci_dev *pdev,
cfg->afu_cookie = cfg->ops->create_afu(pdev);
if (unlikely(!cfg->afu_cookie)) {
dev_err(dev, "%s: create_afu failed\n", __func__);
+ rc = -ENOMEM;
goto out_remove;
}