[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <6d26f16646294836b87611f4dc5fe763@huawei.com>
Date: Fri, 4 Mar 2022 12:06:10 +0000
From: "Zhangjiantao(Kirin,Nanjing)" <water.zhangjiantao@...wei.com>
To: "jingoohan1@...il.com" <jingoohan1@...il.com>,
"gustavo.pimentel@...opsys.com" <gustavo.pimentel@...opsys.com>,
"lorenzo.pieralisi@....com" <lorenzo.pieralisi@....com>,
"robh@...nel.org" <robh@...nel.org>, "kw@...ux.com" <kw@...ux.com>,
"bhelgaas@...gle.com" <bhelgaas@...gle.com>,
"linux-pci@...r.kernel.org" <linux-pci@...r.kernel.org>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
CC: Caiyadong <caiyadong@...wei.com>,
guhengsheng <guhengsheng@...ilicon.com>,
"zhangjianrong (E)" <zhangjianrong5@...wei.com>
Subject: [PATCH] PCI: dwc: solve returning success but actually failed
When dma_mapping_error returns error because of no enough memory available, dw_pcie_host_init will return success, which will mislead the callers.
Signed-off-by: zhangjianrong <zhangjianrong5@...wei.com>
Signed-off-by: zhangjiantao <water.zhangjiantao@...wei.com>
---
drivers/pci/controller/dwc/pcie-designware-host.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/pci/controller/dwc/pcie-designware-host.c
b/drivers/pci/controller/dwc/pcie-designware-host.c
index f4755f3a03be..ac691d733848 100644
--- a/drivers/pci/controller/dwc/pcie-designware-host.c
+++ b/drivers/pci/controller/dwc/pcie-designware-host.c
@@ -393,6 +393,7 @@ int dw_pcie_host_init(struct pcie_port *pp)
if (dma_mapping_error(pci->dev, pp->msi_data)) {
dev_err(pci->dev, "Failed to map MSI data\n");
pp->msi_data = 0;
+ ret = -1;
goto err_free_msi;
}
}
--
2.17.1
Powered by blists - more mailing lists