netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] mv643xx_eth: check for valid hw address
@ 2009-12-04 11:51 Denis Kirjanov <kirjanov@gmail.com
  2009-12-04 21:30 ` David Miller
  0 siblings, 1 reply; 4+ messages in thread
From: Denis Kirjanov <kirjanov@gmail.com @ 2009-12-04 11:51 UTC (permalink / raw)
  To: davem; +Cc: netdev

Check for valid hw address.

Signed-off-by: Denis Kirjanov <kirjanov@gmail.com>

---
drivers/net/mv643xx_eth.c |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/drivers/net/mv643xx_eth.c b/drivers/net/mv643xx_eth.c
index 796a493..0b85501 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 -EADDRNOTAVAIL;
+
 	memcpy(dev->dev_addr, sa->sa_data, ETH_ALEN);
 
 	netif_addr_lock_bh(dev);

^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2009-12-09  4:36 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-12-04 11:51 [PATCH] mv643xx_eth: check for valid hw address Denis Kirjanov <kirjanov@gmail.com
2009-12-04 21:30 ` David Miller
2009-12-06 10:36   ` [PATCH] mv643xx_eth: check for valid hw address (resubmit) Denis Kirjanov <kirjanov@gmail.com
2009-12-09  4:36     ` David Miller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).