mirror of
https://github.com/Stichting-MINIX-Research-Foundation/u-boot.git
synced 2025-09-09 20:18:54 -04:00
mpc83xx: protect memcpy to bad address if a local-mac-address is missing from dt
protect memcpy to bad address if a local-mac-address is missing from dt
This commit is contained in:
parent
6752ed088c
commit
b700474785
@ -309,11 +309,13 @@ ft_cpu_setup(void *blob, bd_t *bd)
|
|||||||
|
|
||||||
#ifdef CONFIG_MPC83XX_TSEC1
|
#ifdef CONFIG_MPC83XX_TSEC1
|
||||||
p = ft_get_prop(blob, "/" OF_SOC "/ethernet@24000/local-mac-address", &len);
|
p = ft_get_prop(blob, "/" OF_SOC "/ethernet@24000/local-mac-address", &len);
|
||||||
|
if (p != NULL)
|
||||||
memcpy(p, bd->bi_enetaddr, 6);
|
memcpy(p, bd->bi_enetaddr, 6);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef CONFIG_MPC83XX_TSEC2
|
#ifdef CONFIG_MPC83XX_TSEC2
|
||||||
p = ft_get_prop(blob, "/" OF_SOC "/ethernet@25000/local-mac-address", &len);
|
p = ft_get_prop(blob, "/" OF_SOC "/ethernet@25000/local-mac-address", &len);
|
||||||
|
if (p != NULL)
|
||||||
memcpy(p, bd->bi_enet1addr, 6);
|
memcpy(p, bd->bi_enet1addr, 6);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user