[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1330099282-4588-3-git-send-email-danny.kukawka@bisect.de>
Date: Fri, 24 Feb 2012 17:01:12 +0100
From: Danny Kukawka <danny.kukawka@...ect.de>
To: "David S. Miller" <davem@...emloft.net>
Cc: Danny Kukawka <dkukawka@...e.de>,
Lucas De Marchi <lucas.demarchi@...fusion.mobi>,
Javier Martinez Canillas <martinez.javier@...il.com>,
Jiri Pirko <jpirko@...hat.com>, netdev@...r.kernel.org,
linux-kernel@...r.kernel.org
Subject: [PATCH 02/12] cris/eth_v10: check given MAC address, if invalid return -EADDRNOTAVAIL
Check if given address is valid in .ndo_set_mac_address, if
invalid return -EADDRNOTAVAIL as eth_mac_addr() already does
if is_valid_ether_addr() fails.
Signed-off-by: Danny Kukawka <danny.kukawka@...ect.de>
---
drivers/net/cris/eth_v10.c | 3 +++
1 files changed, 3 insertions(+), 0 deletions(-)
diff --git a/drivers/net/cris/eth_v10.c b/drivers/net/cris/eth_v10.c
index 7cb2785..e450d8a 100644
--- a/drivers/net/cris/eth_v10.c
+++ b/drivers/net/cris/eth_v10.c
@@ -424,6 +424,9 @@ e100_set_mac_address(struct net_device *dev, void *p)
struct net_local *np = netdev_priv(dev);
struct sockaddr *addr = p;
+ if (!is_valid_ether_addr(addr->sa_data))
+ return -EADDRNOTAVAIL;
+
spin_lock(&np->lock); /* preemption protection */
/* remember it */
--
1.7.8.3
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists