From patchwork Thu Oct 28 20:16:47 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Casey Leedom X-Patchwork-Id: 69496 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 99383B6EE9 for ; Fri, 29 Oct 2010 07:16:56 +1100 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1759747Ab0J1UQw (ORCPT ); Thu, 28 Oct 2010 16:16:52 -0400 Received: from stargate.chelsio.com ([67.207.112.58]:9160 "EHLO stargate.chelsio.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754495Ab0J1UQv (ORCPT ); Thu, 28 Oct 2010 16:16:51 -0400 Received: from okham.asicdesigners.com (okham.asicdesigners.com [10.192.164.4]) by stargate.chelsio.com (8.13.1/8.13.1) with ESMTP id o9SKGnRw008330; Thu, 28 Oct 2010 13:16:49 -0700 Received: from leedom by okham.asicdesigners.com with local (Exim 4.71) (envelope-from ) id 1PBYu0-0000BI-Ve; Thu, 28 Oct 2010 13:16:49 -0700 From: Casey Leedom To: davem@davemloft.net Cc: netdev@vger.kernel.org, Casey Leedom Subject: [PATCH] cxgb4vf: fix crash due to manipulating queues before registration Date: Thu, 28 Oct 2010 13:16:47 -0700 Message-Id: <1288297007-663-1-git-send-email-leedom@chelsio.com> X-Mailer: git-send-email 1.7.0.4 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org Before commit "net: allocate tx queues in register_netdevice" netif_tx_stop_all_queues and related functions could be used between device allocation and registration but now only after registration. cxgb4 has such a call before registration and crashes now. Move it after register_netdev. Signed-off-by: Casey Leedom --- drivers/net/cxgb4vf/cxgb4vf_main.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/drivers/net/cxgb4vf/cxgb4vf_main.c b/drivers/net/cxgb4vf/cxgb4vf_main.c index 555ecc5..b9d92a5 100644 --- a/drivers/net/cxgb4vf/cxgb4vf_main.c +++ b/drivers/net/cxgb4vf/cxgb4vf_main.c @@ -2600,7 +2600,6 @@ static int __devinit cxgb4vf_pci_probe(struct pci_dev *pdev, pi->xact_addr_filt = -1; pi->rx_offload = RX_CSO; netif_carrier_off(netdev); - netif_tx_stop_all_queues(netdev); netdev->irq = pdev->irq; netdev->features = (NETIF_F_SG | NETIF_F_TSO | NETIF_F_TSO6 | @@ -2661,6 +2660,7 @@ static int __devinit cxgb4vf_pci_probe(struct pci_dev *pdev, continue; } + netif_tx_stop_all_queues(netdev); set_bit(pidx, &adapter->registered_device_map); } if (adapter->registered_device_map == 0) {