public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
* [U-Boot] [PATCH] powerpc/mpc85xx: Don't deref NULL if qman portal lacks cell-index
@ 2015-04-17 23:10 Scott Wood
  2015-05-05 16:36 ` York Sun
  0 siblings, 1 reply; 2+ messages in thread
From: Scott Wood @ 2015-04-17 23:10 UTC (permalink / raw)
  To: u-boot

Signed-off-by: Scott Wood <scottwood@freescale.com>
Cc: Madalin-Cristian Bucur <madalin.bucur@freescale.com>
---
 arch/powerpc/cpu/mpc85xx/portals.c | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/arch/powerpc/cpu/mpc85xx/portals.c b/arch/powerpc/cpu/mpc85xx/portals.c
index ec3b292..3777c6f 100644
--- a/arch/powerpc/cpu/mpc85xx/portals.c
+++ b/arch/powerpc/cpu/mpc85xx/portals.c
@@ -249,8 +249,13 @@ void fdt_fixup_qportals(void *blob)
 #ifdef CONFIG_FSL_CORENET
 		u32 liodns[2];
 #endif
-		const int *ci = fdt_getprop(blob, off, "cell-index", NULL);
-		int i = *ci;
+		const int *ci = fdt_getprop(blob, off, "cell-index", &err);
+		int i;
+
+		if (!ci)
+			goto err;
+
+		i = *ci;
 #ifdef CONFIG_SYS_DPAA_FMAN
 		int j;
 #endif
-- 
2.1.0

^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2015-05-05 16:36 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-04-17 23:10 [U-Boot] [PATCH] powerpc/mpc85xx: Don't deref NULL if qman portal lacks cell-index Scott Wood
2015-05-05 16:36 ` York Sun

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox