Commit 2210dfec authored by Krzysztof Halasa's avatar Krzysztof Halasa Committed by Jeff Garzik

[netdrvr tulip] fix use-after-free

The attached patch fixes an "oops" in tulip driver when a live interface
is deactivated (i.e. PC Card ejected or module unloaded) without being
brought down first.
parent 1eb6501c
...@@ -1761,11 +1761,11 @@ static void __devexit tulip_remove_one (struct pci_dev *pdev) ...@@ -1761,11 +1761,11 @@ static void __devexit tulip_remove_one (struct pci_dev *pdev)
return; return;
tp = netdev_priv(dev); tp = netdev_priv(dev);
unregister_netdev(dev);
pci_free_consistent (pdev, pci_free_consistent (pdev,
sizeof (struct tulip_rx_desc) * RX_RING_SIZE + sizeof (struct tulip_rx_desc) * RX_RING_SIZE +
sizeof (struct tulip_tx_desc) * TX_RING_SIZE, sizeof (struct tulip_tx_desc) * TX_RING_SIZE,
tp->rx_ring, tp->rx_ring_dma); tp->rx_ring, tp->rx_ring_dma);
unregister_netdev (dev);
if (tp->mtable) if (tp->mtable)
kfree (tp->mtable); kfree (tp->mtable);
#ifndef USE_IO_OPS #ifndef USE_IO_OPS
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment