aboutsummaryrefslogtreecommitdiff
path: root/drivers/ram/stm32_sdram.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/ram/stm32_sdram.c')
-rw-r--r--drivers/ram/stm32_sdram.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/ram/stm32_sdram.c b/drivers/ram/stm32_sdram.c
index 540ad851387..3e25cc7a018 100644
--- a/drivers/ram/stm32_sdram.c
+++ b/drivers/ram/stm32_sdram.c
@@ -268,6 +268,7 @@ static int stm32_fmc_of_to_plat(struct udevice *dev)
u32 swp_fmc;
ofnode bank_node;
char *bank_name;
+ char _bank_name[128] = {0};
u8 bank = 0;
int ret;
@@ -300,6 +301,8 @@ static int stm32_fmc_of_to_plat(struct udevice *dev)
dev_for_each_subnode(bank_node, dev) {
/* extract the bank index from DT */
bank_name = (char *)ofnode_get_name(bank_node);
+ strlcpy(_bank_name, bank_name, sizeof(_bank_name));
+ bank_name = (char *)_bank_name;
strsep(&bank_name, "@");
if (!bank_name) {
pr_err("missing sdram bank index");