From c33d8da2a0cea60c85f2455a5c8328648a18f4fc Mon Sep 17 00:00:00 2001 From: Rudi Date: Sun, 26 Feb 2017 11:18:53 +0100 Subject: [PATCH] mx6_cubox-i_spl: Do not write to string constant Signed-off-by: Rudi --- board/solidrun/mx6_cubox-i/mx6_cubox-i_spl.c | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/board/solidrun/mx6_cubox-i/mx6_cubox-i_spl.c b/board/solidrun/mx6_cubox-i/mx6_cubox-i_spl.c index 06cbe7c520..bfb56822d0 100644 --- a/board/solidrun/mx6_cubox-i/mx6_cubox-i_spl.c +++ b/board/solidrun/mx6_cubox-i/mx6_cubox-i_spl.c @@ -88,8 +88,8 @@ enum boot_device get_boot_device(void) { static const char *build_dts_name(void) { - char *dt_prefix; - char *dt_suffix; + const char *dt_prefix, *dt_suffix; + static char dt_name[48]; int val1, val2, val3; switch (spl_get_imx_type()){ @@ -119,11 +119,12 @@ static const char *build_dts_name(void) /* * Machine selection - - * Machine val1, val2 - * ------------------------- - * HB rev 3.x x 0 - * CBi 0 1 - * HB 1 1 + * Machine val1, val2, val3 + * ------------------------------- + * HB2 x x 0 + * HB rev 3.x x 0 1 + * CBi 0 1 1 + * HB 1 1 1 */ if (val3 == 0) { @@ -136,7 +137,7 @@ static const char *build_dts_name(void) dt_suffix = "-hummingboard.dtb"; } - return strcat(dt_prefix, dt_suffix); + return strcat(strcpy(dt_name, dt_prefix), dt_suffix); } #include "asm/arch/mx6_ddr_regs.h"