From: Wei Yongjun Date: Tue, 28 Apr 2020 14:18:55 +0000 (+0000) Subject: scsi: cxlflash: Fix error return code in cxlflash_probe() X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=d0b1e4a638d670a09f42017a3e567dc846931ba8;p=linux.git 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 Signed-off-by: Wei Yongjun Signed-off-by: Martin K. Petersen --- diff --git a/drivers/scsi/cxlflash/main.c b/drivers/scsi/cxlflash/main.c index fbd2ae40dab4f..fcc5aa9f60147 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; }