From: "Denis Kirjanov <kirjanov@gmail.com" <kirjanov@gmail.com>
To: davem@davemloft.net
Cc: netdev@vger.kernel.org
Subject: [PATCH] mv643xx_eth: check for valid hw address
Date: Fri, 4 Dec 2009 14:51:38 +0300 [thread overview]
Message-ID: <20091204115138.GA5532@coldcone> (raw)
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);
next reply other threads:[~2009-12-04 11:49 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-12-04 11:51 Denis Kirjanov <kirjanov@gmail.com [this message]
2009-12-04 21:30 ` [PATCH] mv643xx_eth: check for valid hw address 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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20091204115138.GA5532@coldcone \
--to=kirjanov@gmail.com \
--cc=davem@davemloft.net \
--cc=netdev@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).