Skip to contentSkip to conversation

powerpc/mpc85xx: Don't deref NULL if qman portal lacks cell-index

PATCH New Scott Wood 2 participants 2 messages Apr 17, 2015 – May 5, 2015 PowerPC

lore
Share & tools
lore

Scott Wood

author
#0 lore raw

PATCH 1/1 powerpc/mpc85xx: Don't deref NULL if qman portal lacks cell-index

Cc Madalin-Cristian Bucur <[email protected]>
---
 arch/powerpc/cpu/mpc85xx/portals.c | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)
arch/powerpc/cpu/mpc85xx/portals.c +7 -2
index ec3b292..3777c6f 100644
@@ -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
Signature · 1 line
2.1.0