]> 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:18:02 +0000 (13:18 +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 93ef97af22df4dd13b472fdb5f65321a9b93653b..67d681c53c29595f3ccd91d156d4e165d82ffc4e 100644 (file)
@@ -3746,6 +3746,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;
        }