staging: slicoss: use free_netdev(netdev) instead of kfree()
Freeing netdev without free_netdev() leads to net, tx leaks. I might lead to dereferencing freed pointer. The semantic match that finds this problem is as follows: (http://coccinelle.lip6.fr/) @@ struct net_device* dev; @@ -kfree(dev) +free_netdev(dev) Signed-off-by: Vasiliy Kulikov <segooon@gmail.com> Acked-by: Denis Kirjanov <dkirjanov@kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
This commit is contained in:
parent
c4711c3acb
commit
20caa14c59
|
@ -3233,7 +3233,7 @@ static void __devexit slic_entry_remove(struct pci_dev *pcidev)
|
||||||
slic_global.num_slic_cards--;
|
slic_global.num_slic_cards--;
|
||||||
slic_card_cleanup(card);
|
slic_card_cleanup(card);
|
||||||
}
|
}
|
||||||
kfree(dev);
|
free_netdev(dev);
|
||||||
pci_release_regions(pcidev);
|
pci_release_regions(pcidev);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue