From: Yang Yingliang Date: Fri, 1 Dec 2023 03:30:57 +0000 (+0800) Subject: PCI: epf-vntb: Return actual error code during pci_vntb_probe() failure X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=976dc5ff3018552dcfe58018a0cfdf6376318117;p=linux.git PCI: epf-vntb: Return actual error code during pci_vntb_probe() failure If dma_set_mask_and_coherent() in pci_vntb_probe() fails, return the actual error code instead of -EINVAL. Signed-off-by: Yang Yingliang Reviewed-by: Manivannan Sadhasivam Reviewed-by: Dave Jiang Reviewed-by: Ilpo Järvinen Link: https://lore.kernel.org/r/20231201033057.1399131-2-yangyingliang@huaweicloud.com [mani: reworded commit message and subject] Signed-off-by: Manivannan Sadhasivam --- diff --git a/drivers/pci/endpoint/functions/pci-epf-vntb.c b/drivers/pci/endpoint/functions/pci-epf-vntb.c index d4c25b43da238..0675929fc5296 100644 --- a/drivers/pci/endpoint/functions/pci-epf-vntb.c +++ b/drivers/pci/endpoint/functions/pci-epf-vntb.c @@ -1258,7 +1258,7 @@ static int pci_vntb_probe(struct pci_dev *pdev, const struct pci_device_id *id) ret = dma_set_mask_and_coherent(dev, DMA_BIT_MASK(32)); if (ret) { dev_err(dev, "Cannot set DMA mask\n"); - return -EINVAL; + return ret; } ret = ntb_register_device(&ndev->ntb);