From: "Zhangjiantao(Kirin,Nanjing)" <water.zhangjiantao@huawei.com>
To: "jingoohan1@gmail.com" <jingoohan1@gmail.com>,
"gustavo.pimentel@synopsys.com" <gustavo.pimentel@synopsys.com>,
"lorenzo.pieralisi@arm.com" <lorenzo.pieralisi@arm.com>,
"robh@kernel.org" <robh@kernel.org>,
"kw@linux.com" <kw@linux.com>,
"bhelgaas@google.com" <bhelgaas@google.com>,
"linux-pci@vger.kernel.org" <linux-pci@vger.kernel.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Cc: Caiyadong <caiyadong@huawei.com>,
guhengsheng <guhengsheng@hisilicon.com>,
"zhangjianrong (E)" <zhangjianrong5@huawei.com>
Subject: [PATCH] PCI: dwc: solve returning success but actually failed
Date: Fri, 4 Mar 2022 12:06:10 +0000 [thread overview]
Message-ID: <6d26f16646294836b87611f4dc5fe763@huawei.com> (raw)
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@huawei.com>
Signed-off-by: zhangjiantao <water.zhangjiantao@huawei.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
next reply other threads:[~2022-03-04 12:06 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-03-04 12:06 Zhangjiantao(Kirin,Nanjing) [this message]
2022-03-04 17:10 ` Rob Herring
2022-03-04 21:39 ` Bjorn Helgaas
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=6d26f16646294836b87611f4dc5fe763@huawei.com \
--to=water.zhangjiantao@huawei.com \
--cc=bhelgaas@google.com \
--cc=caiyadong@huawei.com \
--cc=guhengsheng@hisilicon.com \
--cc=gustavo.pimentel@synopsys.com \
--cc=jingoohan1@gmail.com \
--cc=kw@linux.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pci@vger.kernel.org \
--cc=lorenzo.pieralisi@arm.com \
--cc=robh@kernel.org \
--cc=zhangjianrong5@huawei.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®