From: Scott Wood Date: Fri, 17 Apr 2015 23:10:06 +0000 (-0500) Subject: powerpc/mpc85xx: Don't deref NULL if qman portal lacks cell-index X-Git-Tag: v2015.07-rc1~2^2~10 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=438031e1bc0a733f9494f2cb954725cd79543e1e;p=u-boot powerpc/mpc85xx: Don't deref NULL if qman portal lacks cell-index Signed-off-by: Scott Wood Cc: Madalin-Cristian Bucur Reviewed-by: York Sun --- diff --git a/arch/powerpc/cpu/mpc85xx/portals.c b/arch/powerpc/cpu/mpc85xx/portals.c index ec3b2924b9..3777c6faa1 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