cxgb4: fix crash due to manipulating queues before registration
authorDimitris Michailidis <dm@chelsio.com>
Thu, 21 Oct 2010 11:29:55 +0000 (11:29 +0000)
committerDavid S. Miller <davem@davemloft.net>
Sun, 24 Oct 2010 22:52:30 +0000 (15:52 -0700)
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: Dimitris Michailidis <dm@chelsio.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/cxgb4/cxgb4_main.c

index 87054e0a57467841be71bcb3e3cfc7517c54bbe8..2a01a23ed409cc1f9059f6ca952786aec03b92fc 100644 (file)
@@ -3658,7 +3658,6 @@ static int __devinit init_one(struct pci_dev *pdev,
                pi->rx_offload = RX_CSO;
                pi->port_id = i;
                netif_carrier_off(netdev);
-               netif_tx_stop_all_queues(netdev);
                netdev->irq = pdev->irq;
 
                netdev->features |= NETIF_F_SG | TSO_FLAGS;
@@ -3730,6 +3729,7 @@ static int __devinit init_one(struct pci_dev *pdev,
 
                        __set_bit(i, &adapter->registered_device_map);
                        adapter->chan_map[adap2pinfo(adapter, i)->tx_chan] = i;
+                       netif_tx_stop_all_queues(adapter->port[i]);
                }
        }
        if (!adapter->registered_device_map) {