diff options
author | Scott Wood <scottwood@freescale.com> | 2015-04-17 18:10:06 -0500 |
---|---|---|
committer | York Sun <yorksun@freescale.com> | 2015-05-04 09:24:57 -0700 |
commit | 438031e1bc0a733f9494f2cb954725cd79543e1e (patch) | |
tree | 7019ef688b7212b4a12bb9bf6498356768ebab27 /arch/powerpc/cpu/mpc85xx/portals.c | |
parent | ea753267d56b6fcb097aff15a8831ef51dc9d615 (diff) | |
download | u-boot-imx-438031e1bc0a733f9494f2cb954725cd79543e1e.zip u-boot-imx-438031e1bc0a733f9494f2cb954725cd79543e1e.tar.gz u-boot-imx-438031e1bc0a733f9494f2cb954725cd79543e1e.tar.bz2 |
powerpc/mpc85xx: Don't deref NULL if qman portal lacks cell-index
Signed-off-by: Scott Wood <scottwood@freescale.com>
Cc: Madalin-Cristian Bucur <madalin.bucur@freescale.com>
Reviewed-by: York Sun <yorksun@freescale.com>
Diffstat (limited to 'arch/powerpc/cpu/mpc85xx/portals.c')
-rw-r--r-- | arch/powerpc/cpu/mpc85xx/portals.c | 9 |
1 files 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 |