[PATCH 01/17] soc/qman: Check ioremap return value

Claudiu Manoil claudiu.manoil at nxp.com
Thu Nov 17 01:40:14 AEDT 2016


From: Madalin Bucur <madalin.bucur at nxp.com>

Signed-off-by: Madalin Bucur <madalin.bucur at nxp.com>
Signed-off-by: Claudiu Manoil <claudiu.manoil at nxp.com>
---
 drivers/soc/fsl/qbman/qman_ccsr.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/soc/fsl/qbman/qman_ccsr.c b/drivers/soc/fsl/qbman/qman_ccsr.c
index 0cace9e..f4e6e70 100644
--- a/drivers/soc/fsl/qbman/qman_ccsr.c
+++ b/drivers/soc/fsl/qbman/qman_ccsr.c
@@ -444,6 +444,9 @@ static int zero_priv_mem(struct device *dev, struct device_node *node,
 	/* map as cacheable, non-guarded */
 	void __iomem *tmpp = ioremap_prot(addr, sz, 0);
 
+	if (!tmpp)
+		return -ENOMEM;
+
 	memset_io(tmpp, 0, sz);
 	flush_dcache_range((unsigned long)tmpp,
 			   (unsigned long)tmpp + sz);
-- 
1.7.11.7



More information about the Linuxppc-dev mailing list