summaryrefslogtreecommitdiff
path: root/net
diff options
context:
space:
mode:
Diffstat (limited to 'net')
-rw-r--r--net/eth.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/net/eth.c b/net/eth.c
index 49458c8..321d5b1 100644
--- a/net/eth.c
+++ b/net/eth.c
@@ -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;
}