Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757450Ab2B2PnO (ORCPT ); Wed, 29 Feb 2012 10:43:14 -0500 Received: from wp188.webpack.hosteurope.de ([80.237.132.195]:38761 "EHLO wp188.webpack.hosteurope.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752120Ab2B2PnM (ORCPT ); Wed, 29 Feb 2012 10:43:12 -0500 From: Danny Kukawka To: Jon Mason Cc: Danny Kukawka , netdev@vger.kernel.org, "David S. Miller" , linux-kernel@vger.kernel.org Subject: [PATCH 7/8] neterion/s2io: fix s2io_set_mac_addr() to prevent double checks Date: Wed, 29 Feb 2012 16:42:55 +0100 Message-Id: <1330530176-24952-8-git-send-email-danny.kukawka@bisect.de> X-Mailer: git-send-email 1.7.8.3 In-Reply-To: <1330530176-24952-1-git-send-email-danny.kukawka@bisect.de> References: <1330530176-24952-1-git-send-email-danny.kukawka@bisect.de> X-bounce-key: webpack.hosteurope.de;danny.kukawka@bisect.de;1330530192;1e2f3111; Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1500 Lines: 43 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 --- 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 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/