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>
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 @@
#ifdef CONFIG_BOARD_TYPES
bdtype = get_board_type();
+ if (!bdtype)
+ bdtype = "";
+
sprintf(info, "%s%s", bdname, bdtype);
setenv("boardname", info);
#endif