Skip to contentSkip to conversation

scsi: cxlflash: Fix error return code in cxlflash_probe()

PATCH Applied Wei Yongjun 3 participants 3 messages Apr 28, 2020 – May 20, 2020

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 scsi: cxlflash: Fix error return code in cxlflash_probe()

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

---
 drivers/scsi/cxlflash/main.c | 1 +
 1 file changed, 1 insertion(+)
drivers/scsi/cxlflash/main.c +1 -0
index fbd2ae40dab4..fcc5aa9f6014 100644
@@ -3744,6 +3744,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;
 	}
 
Acked-by on v1 1/1
#1 lore raw
Quoted 4 lines · Wei Yongjun

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

Quoted 18 lines
---
 drivers/scsi/cxlflash/main.c | 1 +
 1 file changed, 1 insertion(+)
drivers/scsi/cxlflash/main.c +1 -0
index fbd2ae40dab4..fcc5aa9f6014 100644
@@ -3744,6 +3744,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;
 	}