netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Denis Kirjanov <kirjanov@gmail.com" <kirjanov@gmail.com>
To: David Miller <davem@davemloft.net>
Cc: netdev@vger.kernel.org
Subject: [PATCH] mv643xx_eth: check for valid hw address (resubmit)
Date: Sun, 6 Dec 2009 13:36:33 +0300	[thread overview]
Message-ID: <20091206103633.GA4407@coldcone> (raw)
In-Reply-To: <20091204.133042.10804388.davem@davemloft.net>

On Fri, Dec 04, 2009 at 13:30 -0800, David Miller wrote:
> From: "Denis Kirjanov <kirjanov@gmail.com" <kirjanov@gmail.com>
> Date: Fri, 4 Dec 2009 14:51:38 +0300
> 
> > Check for valid hw address.
> > 
> > Signed-off-by: Denis Kirjanov <kirjanov@gmail.com>
> 
> Assuming we don't accept your other patch this needs
> to return -EINVAL.
(resubmitted due the fix in the return value)

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..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);



  reply	other threads:[~2009-12-06 10:34 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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   ` Denis Kirjanov <kirjanov@gmail.com [this message]
2009-12-09  4:36     ` [PATCH] mv643xx_eth: check for valid hw address (resubmit) 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=20091206103633.GA4407@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).