From a29ec08a1b649436248c140a3bc389bc11434c94 Mon Sep 17 00:00:00 2001 From: Denis Kirjanov Date: Tue, 8 Dec 2009 20:36:00 -0800 Subject: [PATCH] mv643xx_eth: check for valid hw address (resubmit) Check for valid hw address. Signed-off-by: Denis Kirjanov Signed-off-by: David S. Miller --- drivers/net/mv643xx_eth.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/net/mv643xx_eth.c b/drivers/net/mv643xx_eth.c index 796a493..1405a17 100644 --- a/drivers/net/mv643xx_eth.c +++ b/drivers/net/mv643xx_eth.c @@ -1827,6 +1827,9 @@ static int mv643xx_eth_set_mac_address(struct net_device *dev, void *addr) { struct sockaddr *sa = addr; + if (!is_valid_ether_addr(sa->sa_data)) + return -EINVAL; + memcpy(dev->dev_addr, sa->sa_data, ETH_ALEN); netif_addr_lock_bh(dev); -- 2.7.4