From: Edward Cree Subject: [PATCH net] sfc: fix addr_list_lock spinlock use before init Date: Tue, 16 Sep 2014 17:05:21 +0100 Message-ID: References: <1410785727-659-1-git-send-email-nikolay@redhat.com> <54185F18.4020003@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Cc: Edward Cree , , , Ben Hutchings , Shradha Shah , Solarflare linux maintainers To: Nikolay Aleksandrov Return-path: Received: from nbfkord-smmo01.seg.att.com ([209.65.160.76]:48591 "EHLO nbfkord-smmo01.seg.att.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754031AbaIPQMe (ORCPT ); Tue, 16 Sep 2014 12:12:34 -0400 In-Reply-To: <54185F18.4020003@redhat.com> Sender: netdev-owner@vger.kernel.org List-ID: Reported by Nikolay Aleksandrov. In efx_init_port() we call efx_mac_reconfigure() to work around a Falcon/A1 limitation, and this calls efx_{arch}_filter_sync_rx_mode(), which takes the addr_list_lock; but this lock is uninitialised, because we haven't called register_netdevice() yet. So, in efx_farch_filter_sync_rx_mode(), check efx_dev_registered() before doing anything else. The EF10 equivalent, efx_ef10_filter_sync_rx_mode(), already has the corresponding check. Signed-off-by: Edward Cree Tested-by: Nikolay Aleksandrov --- drivers/net/ethernet/sfc/farch.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/net/ethernet/sfc/farch.c b/drivers/net/ethernet/sfc/farch.c index 0537381..6859437 100644 --- a/drivers/net/ethernet/sfc/farch.c +++ b/drivers/net/ethernet/sfc/farch.c @@ -2933,6 +2933,9 @@ void efx_farch_filter_sync_rx_mode(struct efx_nic *efx) u32 crc; int bit; + if (!efx_dev_registered(efx)) + return; + netif_addr_lock_bh(net_dev); efx->unicast_filter = !(net_dev->flags & IFF_PROMISC); -- 1.7.11.7