fsl-layerscape/soc.c: do not destroy bootcmd environment
A message that is not in the archive (sent off-list or not yet received): 1b153bce-a66a-45ee-a5c6-963ea6fb1c82.949ef384-8293-46b8-903f-40a477c056ae.3f58dbb3-6e3c-43d9-9553-fe60808a43a3@emailsignatures365.codetwo.com
PATCH 1/1 fsl-layerscape/soc.c: do not destroy bootcmd environment
When an XXX_BOOTCOMMAND isn't defined, the result is that bootcmd is set to some random memory content. Fix it so that the function does nothing in that case and leaves the bootcmd environment unmodified.
Signed-off-by Mike Looijmans <[email protected]>
---
arch/arm/cpu/armv8/fsl-layerscape/soc.c | 5 +++++ 1 file changed, 5 insertions(+)
arch/arm/cpu/armv8/fsl-layerscape/soc.c +5 -0
@@ -811,6 +811,8 @@ __weak int fsl_setenv_bootcmd(void)enum boot_src src =get_boot_src ();char bootcmd_str[MAX_BOOTCMD_SIZE ]; + bootcmd_str[0 ] =0 ; +switch (src) {#ifdef IFC_NOR_BOOTCOMMAND case BOOT_SOURCE_IFC_NOR :
@@ -859,6 +861,9 @@ __weak int fsl_setenv_bootcmd(void)break ; } +if (!bootcmd_str[0 ]) +return 0 ; + ret =env_set ("bootcmd" , bootcmd_str);if (ret) {printf ("Failed to set bootcmd: ret = %d\n" , ret);
Signature · 18 lines
2.34.1 Met vriendelijke groet / kind regards, Mike Looijmans System Expert TOPIC Embedded Products B.V. Materiaalweg 4, 5681 RJ Best The Netherlands T: +31 (0) 499 33 69 69 E: [email protected] W: www.topic.nl Please consider the environment before printing this e-mail
Quoted 5 lines · Mike Looijmans
When an
XXX_BOOTCOMMANDisn't defined, the result is that bootcmd is set to some random memory content. Fix it so that the function does nothing in that case and leaves the bootcmd environment unmodified.Signed-off-by Mike Looijmans <[email protected]>
Thanks, Mike.
Fixes 2141d250f510 ("armv8: fsl-layerscape: bootcmd identification for TFABOOT")
Reviewed-by Dan Carpenter <[email protected]>
regards,
dan carpenter