staging: rtl8192e: Fix use after free in _rtl92e_pci_disconnect()
authorDan Carpenter <dan.carpenter@oracle.com>
Wed, 17 Nov 2021 07:20:16 +0000 (10:20 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 17 Nov 2021 13:08:57 +0000 (14:08 +0100)
commitb535917c51acc97fb0761b1edec85f1f3d02bda4
treeae0a41d728c25761552ed5614701f9554f058377
parentffcf7ae90f4489047d7b076539ba207024dea5f6
staging: rtl8192e: Fix use after free in _rtl92e_pci_disconnect()

The free_rtllib() function frees the "dev" pointer so there is use
after free on the next line.  Re-arrange things to avoid that.

Fixes: 66898177e7e5 ("staging: rtl8192e: Fix unload/reload problem")
Cc: stable <stable@vger.kernel.org>
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Link: https://lore.kernel.org/r/20211117072016.GA5237@kili
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/rtl8192e/rtl8192e/rtl_core.c