diff options
author | Wei Yongjun <weiyongjun1@huawei.com> | 2020-04-28 17:18:55 +0300 |
---|---|---|
committer | Martin K. Petersen <martin.petersen@oracle.com> | 2020-05-20 04:01:32 +0300 |
commit | d0b1e4a638d670a09f42017a3e567dc846931ba8 (patch) | |
tree | dbcdbb62b06370edce9ce6fc98f882f8f1a51fd9 /drivers/scsi/cxlflash | |
parent | f48b285ae658b50f4ba2d3a267522f572720de6d (diff) | |
download | linux-d0b1e4a638d670a09f42017a3e567dc846931ba8.tar.xz |
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.
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>
Diffstat (limited to 'drivers/scsi/cxlflash')
-rw-r--r-- | drivers/scsi/cxlflash/main.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/scsi/cxlflash/main.c b/drivers/scsi/cxlflash/main.c index fbd2ae40dab4..fcc5aa9f6014 100644 --- a/drivers/scsi/cxlflash/main.c +++ b/drivers/scsi/cxlflash/main.c @@ -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; } |