Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932232Ab2BXQCp (ORCPT ); Fri, 24 Feb 2012 11:02:45 -0500 Received: from wp188.webpack.hosteurope.de ([80.237.132.195]:53343 "EHLO wp188.webpack.hosteurope.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932150Ab2BXQCl (ORCPT ); Fri, 24 Feb 2012 11:02:41 -0500 From: Danny Kukawka To: Ursula Braun , Frank Blaschka , linux390@de.ibm.com, Martin Schwidefsky , Heiko Carstens Cc: Danny Kukawka , linux-s390@vger.kernel.org, "David S. Miller" , linux-kernel@vger.kernel.org Subject: [PATCH 11/12] s390/net/qeth_l2_main: check given MAC address, if invalid return -EADDRNOTAVAIL Date: Fri, 24 Feb 2012 17:01:21 +0100 Message-Id: <1330099282-4588-12-git-send-email-danny.kukawka@bisect.de> X-Mailer: git-send-email 1.7.8.3 In-Reply-To: <1330099282-4588-1-git-send-email-danny.kukawka@bisect.de> References: <1330099282-4588-1-git-send-email-danny.kukawka@bisect.de> X-bounce-key: webpack.hosteurope.de;danny.kukawka@bisect.de;1330099361;fe57822b; Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1085 Lines: 32 Check if given address is valid in .ndo_set_mac_address/ qeth_l2_set_mac_address(), if invalid return -EADDRNOTAVAIL as eth_mac_addr() already does if is_valid_ether_addr() fails. Signed-off-by: Danny Kukawka --- drivers/s390/net/qeth_l2_main.c | 3 +++ 1 files changed, 3 insertions(+), 0 deletions(-) diff --git a/drivers/s390/net/qeth_l2_main.c b/drivers/s390/net/qeth_l2_main.c index e5c9cf1..d10b3a4 100644 --- a/drivers/s390/net/qeth_l2_main.c +++ b/drivers/s390/net/qeth_l2_main.c @@ -661,6 +661,9 @@ static int qeth_l2_set_mac_address(struct net_device *dev, void *p) struct qeth_card *card = dev->ml_priv; int rc = 0; + if (!is_valid_ether_addr(addr->sa_data)) + return -EADDRNOTAVAIL; + QETH_CARD_TEXT(card, 3, "setmac"); if (qeth_l2_verify_dev(dev) != QETH_REAL_CARD) { -- 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/