]> git.kernelconcepts.de Git - karo-tx-uboot.git/commitdiff
karo: common: check pointer returned by fdt_getprop() before accessing it
authorLothar Waßmann <LW@KARO-electronics.de>
Thu, 24 Oct 2013 10:58:42 +0000 (12:58 +0200)
committerLothar Waßmann <LW@KARO-electronics.de>
Thu, 24 Oct 2013 10:58:42 +0000 (12:58 +0200)
board/karo/common/fdt.c

index f308bb65d22a79b1d22b01dadd26233fa6b7734a..972805f1dfc3bf5dc8d7a4f506db8581c588db41 100644 (file)
@@ -254,7 +254,7 @@ static int karo_fdt_flexcan_enabled(void *blob)
                        continue;
                }
                status = fdt_getprop(blob, off, "status", NULL);
-               if (strcmp(status, "okay") == 0) {
+               if (status && strcmp(status, "okay") == 0) {
                        debug("%s is enabled\n", can_ifs[i]);
                        return 1;
                }