Return-path: Received: from mail-ob0-f171.google.com ([209.85.214.171]:38080 "EHLO mail-ob0-f171.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751502Ab3AGRVT convert rfc822-to-8bit (ORCPT ); Mon, 7 Jan 2013 12:21:19 -0500 MIME-Version: 1.0 In-Reply-To: <20130107095548.GA6931@redhat.com> References: <20130107095548.GA6931@redhat.com> From: =?ISO-8859-2?Q?Micha=B3_Miros=B3aw?= Date: Mon, 7 Jan 2013 18:20:58 +0100 Message-ID: (sfid-20130107_182126_853021_C22C5628) Subject: Re: [PATCH repost] net,wireless: check against default_ethtool_ops To: Stanislaw Gruszka Cc: netdev@vger.kernel.org, "David S. Miller" , Eric Dumazet , Ben Greear , =?ISO-8859-1?Q?Bj=F8rn_Mork?= , linux-wireless@vger.kernel.org, Ben Hutchings Content-Type: text/plain; charset=UTF-8 Sender: linux-wireless-owner@vger.kernel.org List-ID: 2013/1/7 Stanislaw Gruszka : > Since: > > commit 2c60db037034d27f8c636403355d52872da92f81 > Author: Eric Dumazet > Date: Sun Sep 16 09:17:26 2012 +0000 > > net: provide a default dev->ethtool_ops > > wireless core does not correctly assign ethtool_ops. In order to fix > the problem, and avoid assigning ethtool_ops on each individual cfg80211 > drivers, we check against default_ethool_ops pointer instead of NULL in > wireless core. [...] You could instead move the assignment of default ethtool_ops to just after call_netdevice_notifiers(NETDEV_REGISTER) in register_netdevice() or just after call_netdevice_notifiers(NETDEV_POST_INIT) and initialize the default wireless ethtool_ops in NETDEV_POST_INIT hook. That will avoid the export. Either way is good because register_netdevice() is called under RTNL, so ethtool_ops can't be called until it returns. NETDEV_POST_INIT seams more natural to me, but it's not a strong opinion. Best Regards, Michał Mirosław