[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20200924190623.3251c2ac@xhacker.debian>
Date: Thu, 24 Sep 2020 19:06:23 +0800
From: Jisheng Zhang <Jisheng.Zhang@...aptics.com>
To: Kishon Vijay Abraham I <kishon@...com>,
Lorenzo Pieralisi <lorenzo.pieralisi@....com>,
Rob Herring <robh@...nel.org>,
Bjorn Helgaas <bhelgaas@...gle.com>,
Jingoo Han <jingoohan1@...il.com>,
Kukjin Kim <kgene@...nel.org>,
Krzysztof Kozlowski <krzk@...nel.org>,
Richard Zhu <hongxing.zhu@....com>,
Lucas Stach <l.stach@...gutronix.de>,
Shawn Guo <shawnguo@...nel.org>,
Sascha Hauer <s.hauer@...gutronix.de>,
Pengutronix Kernel Team <kernel@...gutronix.de>,
Fabio Estevam <festevam@...il.com>,
NXP Linux Team <linux-imx@....com>,
Yue Wang <yue.wang@...ogic.com>,
Kevin Hilman <khilman@...libre.com>,
Neil Armstrong <narmstrong@...libre.com>,
Jerome Brunet <jbrunet@...libre.com>,
Martin Blumenstingl <martin.blumenstingl@...glemail.com>,
Jesper Nilsson <jesper.nilsson@...s.com>,
Gustavo Pimentel <gustavo.pimentel@...opsys.com>,
Xiaowei Song <songxiaowei@...ilicon.com>,
Binghui Wang <wangbinghui@...ilicon.com>,
Andy Gross <agross@...nel.org>,
Bjorn Andersson <bjorn.andersson@...aro.org>,
Stanimir Varbanov <svarbanov@...sol.com>,
Pratyush Anand <pratyush.anand@...il.com>,
Thierry Reding <thierry.reding@...il.com>,
Jonathan Hunter <jonathanh@...dia.com>,
Kunihiko Hayashi <hayashi.kunihiko@...ionext.com>,
Masahiro Yamada <yamada.masahiro@...ionext.com>
Cc: linux-omap@...r.kernel.org, linux-pci@...r.kernel.org,
linux-arm-kernel@...ts.infradead.org, linux-kernel@...r.kernel.org,
linux-samsung-soc@...r.kernel.org,
linux-amlogic@...ts.infradead.org, linux-arm-kernel@...s.com,
linux-arm-msm@...r.kernel.org, linux-tegra@...r.kernel.org
Subject: [PATCH v2 2/5] PCI: dwc: Check alloc_page() return value
We need to check alloc_page() succeed or not before continuing.
Signed-off-by: Jisheng Zhang <Jisheng.Zhang@...aptics.com>
---
drivers/pci/controller/dwc/pcie-designware-host.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/drivers/pci/controller/dwc/pcie-designware-host.c b/drivers/pci/controller/dwc/pcie-designware-host.c
index 0a19de946351..9e04e8ef3aa4 100644
--- a/drivers/pci/controller/dwc/pcie-designware-host.c
+++ b/drivers/pci/controller/dwc/pcie-designware-host.c
@@ -303,6 +303,11 @@ void dw_pcie_msi_init(struct pcie_port *pp)
u64 msi_target;
pp->msi_page = alloc_page(GFP_KERNEL);
+ if (!pp->msi_page) {
+ dev_err(dev, "Failed to alloc MSI page\n");
+ return;
+ }
+
pp->msi_data = dma_map_page(dev, pp->msi_page, 0, PAGE_SIZE,
DMA_FROM_DEVICE);
if (dma_mapping_error(dev, pp->msi_data)) {
--
2.28.0
Powered by blists - more mailing lists