lkml.org 
[lkml]   [2012]   [Feb]   [29]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH 7/8] neterion/s2io: fix s2io_set_mac_addr() to prevent double checks
Date
Fix s2io_set_mac_addr() to prevent double validation checks from
dev_set_mac_address().

Don't use s2io_set_mac_addr() in s2io_io_resume() since it makes
no sense to copy netdev->dev_addr to itself. Use do_s2io_prog_unicast()
instead since this is what's needed and checked here.

Signed-off-by: Danny Kukawka <danny.kukawka@bisect.de>
---
drivers/net/ethernet/neterion/s2io.c | 5 +----
1 files changed, 1 insertions(+), 4 deletions(-)
diff --git a/drivers/net/ethernet/neterion/s2io.c b/drivers/net/ethernet/neterion/s2io.c
index 22a8de0..cf7b3eb 100644
--- a/drivers/net/ethernet/neterion/s2io.c
+++ b/drivers/net/ethernet/neterion/s2io.c
@@ -5247,9 +5247,6 @@ static int s2io_set_mac_addr(struct net_device *dev, void *p)
{
struct sockaddr *addr = p;

- if (!is_valid_ether_addr(addr->sa_data))
- return -EADDRNOTAVAIL;
-
memcpy(dev->dev_addr, addr->sa_data, dev->addr_len);

/* store the MAC address in CAM */
@@ -8658,7 +8655,7 @@ static void s2io_io_resume(struct pci_dev *pdev)
return;
}

- if (s2io_set_mac_addr(netdev, netdev->dev_addr) == FAILURE) {
+ if (do_s2io_prog_unicast(netdev, netdev->dev_addr) == FAILURE) {
s2io_card_down(sp);
pr_err("Can't restore mac addr after reset.\n");
return;
--
1.7.8.3


\
 
 \ /
  Last update: 2012-02-29 16:47    [W:0.131 / U:0.264 seconds]
©2003-2014 Jasper Spaans. Advertise on this site