Skip to content

Commit

Permalink
cxgb4: fix crash due to manipulating queues before registration
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Dimitris Michailidis authored and David S. Miller committed Oct 24, 2010
1 parent 2d3359f commit 8f6d9f4
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/net/cxgb4/cxgb4_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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) {
Expand Down

0 comments on commit 8f6d9f4

Please sign in to comment.