summaryrefslogtreecommitdiff
path: root/board/samsung
diff options
context:
space:
mode:
authorPrzemyslaw Marczak <p.marczak@samsung.com>2015-10-27 13:07:54 +0100
committerMinkyu Kang <mk7.kang@samsung.com>2015-11-02 10:37:59 +0900
commitbc3f39ea0d3c9339b7f09b1d766b6a62e1921033 (patch)
treea995db40b0242cc4aac71787598305e0223ff420 /board/samsung
parent0e067a65f57189703668826d9841fea477026bf6 (diff)
downloadu-boot-imx-bc3f39ea0d3c9339b7f09b1d766b6a62e1921033.zip
u-boot-imx-bc3f39ea0d3c9339b7f09b1d766b6a62e1921033.tar.gz
u-boot-imx-bc3f39ea0d3c9339b7f09b1d766b6a62e1921033.tar.bz2
samsung: board/misc: check returned pointer for get_board_type() calls
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>
Diffstat (limited to 'board/samsung')
-rw-r--r--board/samsung/common/board.c4
-rw-r--r--board/samsung/common/misc.c3
2 files changed, 5 insertions, 2 deletions
diff --git a/board/samsung/common/board.c b/board/samsung/common/board.c
index d32c75d..1334c22 100644
--- a/board/samsung/common/board.c
+++ b/board/samsung/common/board.c
@@ -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;
}
diff --git a/board/samsung/common/misc.c b/board/samsung/common/misc.c
index e0e2c48..c8316d8 100644
--- a/board/samsung/common/misc.c
+++ b/board/samsung/common/misc.c
@@ -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