summaryrefslogtreecommitdiffstats
path: root/arch/arm/boards/phytec-som-imx6
diff options
context:
space:
mode:
authorAhmad Fatoum <a.fatoum@pengutronix.de>2024-02-20 13:20:04 +0100
committerSascha Hauer <s.hauer@pengutronix.de>2024-03-13 12:00:28 +0100
commitb689eed014e41f1628c12139d6d0de0a2e8b86bd (patch)
tree934bd3c88246fa6fd97f3566b02df0e6a87568d3 /arch/arm/boards/phytec-som-imx6
parent681266fae74374c4799cc4f5e3fec508f7dd9a02 (diff)
downloadbarebox-b689eed014e41f1628c12139d6d0de0a2e8b86bd.tar.gz
barebox-b689eed014e41f1628c12139d6d0de0a2e8b86bd.tar.xz
ARM: i.MX: phytec-som-imx6: use strdup instead of basprintf
Using basprintf to duplicate a string violates memory safety if default_environment_path were to contain a format specifier. clangd warns about this, so fix this by using strdup instead. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20240220122004.3725540-1-a.fatoum@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'arch/arm/boards/phytec-som-imx6')
-rw-r--r--arch/arm/boards/phytec-som-imx6/board.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/arch/arm/boards/phytec-som-imx6/board.c b/arch/arm/boards/phytec-som-imx6/board.c
index bff95221ab..2db3fa1db8 100644
--- a/arch/arm/boards/phytec-som-imx6/board.c
+++ b/arch/arm/boards/phytec-som-imx6/board.c
@@ -231,7 +231,7 @@ static int physom_imx6_probe(struct device *dev)
envdev = "SPI NOR flash";
break;
default:
- environment_path = basprintf(default_environment_path);
+ environment_path = strdup(default_environment_path);
envdev = default_envdev;
break;
}