]> www.infradead.org Git - users/dwmw2/linux.git/commitdiff
scsi: cxlflash: Fix error return code in cxlflash_probe()
authorWei Yongjun <weiyongjun1@huawei.com>
Tue, 28 Apr 2020 14:18:55 +0000 (14:18 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 1 Oct 2020 11:14:45 +0000 (13:14 +0200)
[ 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>
drivers/scsi/cxlflash/main.c

index f987c40c47a13f2f40c4eaf1183e83f95051ad46..443813feaef4701b99c570b11e390d332cddaed8 100644 (file)
@@ -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;
        }