diff options
author | Heinrich Schuchardt <heinrich.schuchardt@canonical.com> | 2023-04-18 02:00:17 +0200 |
---|---|---|
committer | Stefan Roese <sr@denx.de> | 2023-05-03 08:39:23 +0200 |
commit | a61a56a4a50d73ff747ee3fff3c680886ce76d07 (patch) | |
tree | 1d344955c63681fcde9cd94fdf3edaf3d0401bf0 | |
parent | 9ac8107419b0fe86520e4896b9bcadaa68bfb97a (diff) | |
download | u-boot-a61a56a4a50d73ff747ee3fff3c680886ce76d07.zip u-boot-a61a56a4a50d73ff747ee3fff3c680886ce76d07.tar.gz u-boot-a61a56a4a50d73ff747ee3fff3c680886ce76d07.tar.bz2 |
arm: mvebu: avoid buffer overflow in hws_serdes_topology_verify
If serdes type is invalid, we cannot assume that it is a valid index
for serdes_type_to_str[].
Fixes: edb470253346 ("arm: mvebu: Add Armada 38x SERDES / PHY init code from Marvell bin_hdr")
Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
Reviewed-by: Stefan Roese <sr@denx.de>
-rw-r--r-- | arch/arm/mach-mvebu/serdes/a38x/high_speed_env_spec.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/arch/arm/mach-mvebu/serdes/a38x/high_speed_env_spec.c b/arch/arm/mach-mvebu/serdes/a38x/high_speed_env_spec.c index 3349f4e..f69da7e 100644 --- a/arch/arm/mach-mvebu/serdes/a38x/high_speed_env_spec.c +++ b/arch/arm/mach-mvebu/serdes/a38x/high_speed_env_spec.c @@ -824,8 +824,8 @@ u32 hws_serdes_topology_verify(enum serdes_type serdes_type, u32 serdes_id, enum unit_id unit_id; if (serdes_type > RXAUI) { - printf("%s: Warning: Wrong serdes type %s serdes#%d\n", - __func__, serdes_type_to_string[serdes_type], serdes_id); + printf("%s: Warning: Wrong serdes type %d serdes#%d\n", + __func__, serdes_type, serdes_id); return MV_FAIL; } |