mirror of
https://github.com/AsahiLinux/u-boot
synced 2024-11-10 23:24:38 +00:00
net: eth_write_hwaddr: Return error for invalid MACs
If dev->enetaddr was supposed to be set with dev->write_hwaddr() but the MAC address was not valid, return an error. Signed-off-by: Benoît Thébaudeau <benoit.thebaudeau@advansee.com> Cc: Joe Hershberger <joe.hershberger@gmail.com> Acked-by: Mike Frysinger <vapier@gentoo.org>
This commit is contained in:
parent
185f7d9afc
commit
460f949f89
1 changed files with 5 additions and 2 deletions
|
@ -218,9 +218,12 @@ int eth_write_hwaddr(struct eth_device *dev, const char *base_name,
|
|||
}
|
||||
|
||||
if (dev->write_hwaddr &&
|
||||
!eth_mac_skip(eth_number) &&
|
||||
is_valid_ether_addr(dev->enetaddr))
|
||||
!eth_mac_skip(eth_number)) {
|
||||
if (!is_valid_ether_addr(dev->enetaddr))
|
||||
return -1;
|
||||
|
||||
ret = dev->write_hwaddr(dev);
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue