Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit dedabbbc authored by David Matlack's avatar David Matlack Committed by Greg Kroah-Hartman
Browse files

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: default avatarDavid Matlack <dmatlack@google.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 0783c636
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -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;