Commit 6909507e authored by Wei Yongjun's avatar Wei Yongjun Committed by Greg Kroah-Hartman

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

[ Upstream commit d0b1e4a6 ]

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.comAcked-by: default avatarMatthew R. Ochs <mrochs@linux.ibm.com>
Signed-off-by: default avatarWei Yongjun <weiyongjun1@huawei.com>
Signed-off-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
parent d4a74f43
......@@ -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;
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment