Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757318Ab2BXQcl (ORCPT ); Fri, 24 Feb 2012 11:32:41 -0500 Received: from smtp-outbound-2.vmware.com ([208.91.2.13]:36246 "EHLO smtp-outbound-2.vmware.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754094Ab2BXQcj convert rfc822-to-8bit (ORCPT ); Fri, 24 Feb 2012 11:32:39 -0500 From: Bhavesh Davda To: Danny Kukawka CC: Shreyas Bhatewara , "VMware, Inc." , "netdev@vger.kernel.org" , Danny Kukawka , "David S. Miller" , "linux-kernel@vger.kernel.org" Date: Fri, 24 Feb 2012 08:31:44 -0800 Subject: Re: [Pv-drivers] [PATCH 08/12] vmxnet3: check given MAC address, if invalid return -EADDRNOTAVAIL Thread-Topic: [Pv-drivers] [PATCH 08/12] vmxnet3: check given MAC address, if invalid return -EADDRNOTAVAIL Thread-Index: AczzEew6LTaaAN7XTtCfVqUmRm62bw== Message-ID: <085E4D48-DF23-4C85-84DF-8321CA236304@vmware.com> References: <1330099282-4588-1-git-send-email-danny.kukawka@bisect.de> <1330099282-4588-9-git-send-email-danny.kukawka@bisect.de> In-Reply-To: <1330099282-4588-9-git-send-email-danny.kukawka@bisect.de> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: acceptlanguage: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 8BIT MIME-Version: 1.0 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1519 Lines: 46 Lgtm. Reviewed-by: Bhavesh Davda - Bhavesh (From my iPhone) On Feb 24, 2012, at 8:01 AM, "Danny Kukawka" wrote: > Check if given address is valid in .ndo_set_mac_address/ > vmxnet3_set_mac_addr(), if invalid return -EADDRNOTAVAIL as > eth_mac_addr() already does if is_valid_ether_addr() fails. > > Signed-off-by: Danny Kukawka > --- > drivers/net/vmxnet3/vmxnet3_drv.c | 3 +++ > 1 files changed, 3 insertions(+), 0 deletions(-) > > diff --git a/drivers/net/vmxnet3/vmxnet3_drv.c b/drivers/net/vmxnet3/vmxnet3_drv.c > index e1562e8..bd2a7cd 100644 > --- a/drivers/net/vmxnet3/vmxnet3_drv.c > +++ b/drivers/net/vmxnet3/vmxnet3_drv.c > @@ -2331,6 +2331,9 @@ vmxnet3_set_mac_addr(struct net_device *netdev, void *p) > struct sockaddr *addr = p; > struct vmxnet3_adapter *adapter = netdev_priv(netdev); > > + if (!is_valid_ether_addr(addr->sa_data)) > + return -EADDRNOTAVAIL; > + > memcpy(netdev->dev_addr, addr->sa_data, netdev->addr_len); > vmxnet3_write_mac_addr(adapter, addr->sa_data); > > -- > 1.7.8.3 > > _______________________________________________ > Pv-drivers mailing list > Pv-drivers@vmware.com > http://mailman2.vmware.com/mailman/listinfo/pv-drivers -- 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/