diff options
author | David Matlack <dmatlack@google.com> | 2014-05-05 21:02:37 -0700 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2014-05-23 20:08:34 +0900 |
commit | dedabbbcb5ed7c75664b4ca66a525c09fe6acf12 (patch) | |
tree | 6b2256b633748408299942c92539f4bac510ac72 /drivers/staging/slicoss | |
parent | 0783c636d1872123b68522b5afb257917c3d5aa9 (diff) | |
download | lwn-dedabbbcb5ed7c75664b4ca66a525c09fe6acf12.tar.gz lwn-dedabbbcb5ed7c75664b4ca66a525c09fe6acf12.zip |
staging: slicoss: fix use-after-free bug in slic_entry_remove
This patch fixes a use-after-free bug that causes a null pointer
dereference in slic_entry_halt.
Since unregister_netdev() will ultimately call slic_entry_halt (the
net_device ndo_stop() virtual function for this device), we should
call it before freeing the memory used by slic_entry_halt.
Signed-off-by: David Matlack <dmatlack@google.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging/slicoss')
-rw-r--r-- | drivers/staging/slicoss/slicoss.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/staging/slicoss/slicoss.c b/drivers/staging/slicoss/slicoss.c index fde0ff97f5fb..3010501120d2 100644 --- a/drivers/staging/slicoss/slicoss.c +++ b/drivers/staging/slicoss/slicoss.c @@ -2525,9 +2525,10 @@ static void slic_entry_remove(struct pci_dev *pcidev) struct sliccard *card; struct mcast_address *mcaddr, *mlist; + unregister_netdev(dev); + slic_adapter_freeresources(adapter); slic_unmap_mmio_space(adapter); - unregister_netdev(dev); /* free multicast addresses */ mlist = adapter->mcastaddrs; |