]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
samsung: board/misc: check returned pointer for get_board_type() calls
authorPrzemyslaw Marczak <p.marczak@samsung.com>
Tue, 27 Oct 2015 12:07:54 +0000 (13:07 +0100)
committerMinkyu Kang <mk7.kang@samsung.com>
Mon, 2 Nov 2015 01:37:59 +0000 (10:37 +0900)
The function get_board_type() is called in two places by common code,
but the returned pointer was never check.

This commit adds checking the returned pointer, before use it.

Signed-off-by: Przemyslaw Marczak <p.marczak@samsung.com>
Cc: Minkyu Kang <mk7.kang@samsung.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Tested-by: Anand Moon <linux.amoon@gmail.com>
Signed-off-by: Minkyu Kang <mk7.kang@samsung.com>
board/samsung/common/board.c
board/samsung/common/misc.c

index d32c75de50858f131284e28db0c7ed55883f1cb0..1334c22ddd90f171f63540fc9b8bcf798240cb88 100644 (file)
@@ -304,8 +304,8 @@ int checkboard(void)
        printf("Board: %s\n", board_info ? board_info : "unknown");
 #ifdef CONFIG_BOARD_TYPES
        board_info = get_board_type();
-
-       printf("Model: %s\n", board_info ? board_info : "unknown");
+       if (board_info)
+               printf("Type:  %s\n", board_info);
 #endif
        return 0;
 }
index e0e2c48632cf37907170f1888786a2f21361c5a1..c8316d854f1e0393e153a7a7b025b4e433f16098 100644 (file)
@@ -85,6 +85,9 @@ void set_board_info(void)
 
 #ifdef CONFIG_BOARD_TYPES
        bdtype = get_board_type();
+       if (!bdtype)
+               bdtype = "";
+
        sprintf(info, "%s%s", bdname, bdtype);
        setenv("boardname", info);
 #endif