aboutsummaryrefslogtreecommitdiff
path: root/drivers/net
diff options
context:
space:
mode:
authorStephen Hemminger <shemminger@osdl.org>2006-11-17 11:25:23 -0800
committerJeff Garzik <jeff@garzik.org>2006-12-02 00:16:37 -0500
commite487647abbe66390b99f9a32ede4688b255282dd (patch)
tree861f55139902c59218372f1cf69b3b0d752c9d6e /drivers/net
parentbac7e8746ce562556b7bd750c7652154483b15e2 (diff)
[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: Stephen Hemminger <shemminger@osdl.org> Signed-off-by: Jeff Garzik <jeff@garzik.org>
Diffstat (limited to 'drivers/net')
-rw-r--r--drivers/net/chelsio/cxgb2.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/drivers/net/chelsio/cxgb2.c b/drivers/net/chelsio/cxgb2.c
index 37de99b65c1..37037e5890e 100644
--- a/drivers/net/chelsio/cxgb2.c
+++ b/drivers/net/chelsio/cxgb2.c
@@ -1141,11 +1141,11 @@ static int __devinit init_one(struct pci_dev *pdev,
t1_free_sw_modules(adapter);
out_free_dev:
if (adapter) {
- if (adapter->regs) iounmap(adapter->regs);
+ if (adapter->regs)
+ iounmap(adapter->regs);
for (i = bi->port_number - 1; i >= 0; --i)
- if (adapter->port[i].dev) {
- kfree(adapter->port[i].dev);
- }
+ if (adapter->port[i].dev)
+ free_netdev(adapter->port[i].dev);
}
pci_release_regions(pdev);
out_disable_pdev:
@@ -1175,9 +1175,9 @@ static void __devexit remove_one(struct pci_dev *pdev)
t1_free_sw_modules(adapter);
iounmap(adapter->regs);
while (--i >= 0)
- if (adapter->port[i].dev) {
- kfree(adapter->port[i].dev);
- }
+ if (adapter->port[i].dev)
+ free_netdev(adapter->port[i].dev);
+
pci_release_regions(pdev);
pci_disable_device(pdev);
pci_set_drvdata(pdev, NULL);