Commit e487647a authored by Stephen Hemminger's avatar Stephen Hemminger Committed by Jeff Garzik

[PATCH] chelsio: free_netdev

Network devices need to be free'd with free_netdev() not kfree()
otherwise the kernel will panic if an application has /sys/class/net/ethX/value
open and reads it.
Signed-off-by: default avatarStephen Hemminger <shemminger@osdl.org>
Signed-off-by: default avatarJeff Garzik <jeff@garzik.org>
parent bac7e874
...@@ -1141,11 +1141,11 @@ static int __devinit init_one(struct pci_dev *pdev, ...@@ -1141,11 +1141,11 @@ static int __devinit init_one(struct pci_dev *pdev,
t1_free_sw_modules(adapter); t1_free_sw_modules(adapter);
out_free_dev: out_free_dev:
if (adapter) { if (adapter) {
if (adapter->regs) iounmap(adapter->regs); if (adapter->regs)
iounmap(adapter->regs);
for (i = bi->port_number - 1; i >= 0; --i) for (i = bi->port_number - 1; i >= 0; --i)
if (adapter->port[i].dev) { if (adapter->port[i].dev)
kfree(adapter->port[i].dev); free_netdev(adapter->port[i].dev);
}
} }
pci_release_regions(pdev); pci_release_regions(pdev);
out_disable_pdev: out_disable_pdev:
...@@ -1175,9 +1175,9 @@ static void __devexit remove_one(struct pci_dev *pdev) ...@@ -1175,9 +1175,9 @@ static void __devexit remove_one(struct pci_dev *pdev)
t1_free_sw_modules(adapter); t1_free_sw_modules(adapter);
iounmap(adapter->regs); iounmap(adapter->regs);
while (--i >= 0) while (--i >= 0)
if (adapter->port[i].dev) { if (adapter->port[i].dev)
kfree(adapter->port[i].dev); free_netdev(adapter->port[i].dev);
}
pci_release_regions(pdev); pci_release_regions(pdev);
pci_disable_device(pdev); pci_disable_device(pdev);
pci_set_drvdata(pdev, NULL); pci_set_drvdata(pdev, NULL);
......
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