diff options
author | Kim Phillips <kim.phillips@freescale.com> | 2007-01-30 16:15:21 -0600 |
---|---|---|
committer | Kim Phillips <kim.phillips@freescale.com> | 2007-03-02 11:05:53 -0600 |
commit | b70047478570e371ce7223be342ce98afea0f7d6 (patch) | |
tree | 02583b6180e82f48b8ec5681a9b24c93f130217d /cpu/mpc83xx | |
parent | 6752ed088c75c26a89b70c46b7326a4cd6015f29 (diff) | |
download | u-boot-b70047478570e371ce7223be342ce98afea0f7d6.tar.gz u-boot-b70047478570e371ce7223be342ce98afea0f7d6.tar.bz2 u-boot-b70047478570e371ce7223be342ce98afea0f7d6.zip |
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
Diffstat (limited to 'cpu/mpc83xx')
-rw-r--r-- | cpu/mpc83xx/cpu.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/cpu/mpc83xx/cpu.c b/cpu/mpc83xx/cpu.c index 15e04ba5f7..f83981e8b8 100644 --- a/cpu/mpc83xx/cpu.c +++ b/cpu/mpc83xx/cpu.c @@ -309,11 +309,13 @@ ft_cpu_setup(void *blob, bd_t *bd) #ifdef CONFIG_MPC83XX_TSEC1 p = ft_get_prop(blob, "/" OF_SOC "/ethernet@24000/local-mac-address", &len); + if (p != NULL) memcpy(p, bd->bi_enetaddr, 6); #endif #ifdef CONFIG_MPC83XX_TSEC2 p = ft_get_prop(blob, "/" OF_SOC "/ethernet@25000/local-mac-address", &len); + if (p != NULL) memcpy(p, bd->bi_enet1addr, 6); #endif } |