Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

cxgb3: fix crash due to manipulating queues before registration

Along the same lines as "cxgb4: fix crash due to manipulating queues
before registration" (8f6d9f40476895571df039b6f1f5230ec7faebad), 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: Nishanth Aravamudan <nacc@us.ibm.com>
Cc: eric.dumazet@gmail.com
Cc: sonnyrao@us.ibm.com
Cc: Divy Le Ray <divy@chelsio.com>
Cc: Dimitris Michailidis <dm@chelsio.com>
Cc: netdev@vger.kernel.org
Cc: linux-kernel@vger.kernel.org
Tested-by: Nishanth Aravamudan <nacc@us.ibm.com>
Acked-by: Divy Le Ray <divy@chelsio.com>
Signed-off-by: David S. Miller <davem@davemloft.net>

authored by

Nishanth Aravamudan and committed by
David S. Miller
69dcfc8a b7126d8c

+1 -1
+1 -1
drivers/net/cxgb3/cxgb3_main.c
··· 3301 3301 pi->rx_offload = T3_RX_CSUM | T3_LRO; 3302 3302 pi->port_id = i; 3303 3303 netif_carrier_off(netdev); 3304 - netif_tx_stop_all_queues(netdev); 3305 3304 netdev->irq = pdev->irq; 3306 3305 netdev->mem_start = mmio_start; 3307 3306 netdev->mem_end = mmio_start + mmio_len - 1; ··· 3341 3342 adapter->name = adapter->port[i]->name; 3342 3343 3343 3344 __set_bit(i, &adapter->registered_device_map); 3345 + netif_tx_stop_all_queues(adapter->port[i]); 3344 3346 } 3345 3347 } 3346 3348 if (!adapter->registered_device_map) {