Commit 5e767cca authored by Colin Ian King's avatar Colin Ian King Committed by Greg Kroah-Hartman

staging: rtl8192u: remove redundant nul check on pointer dev

There is a null check on pointer dev which implies it may be null, however
dev can never be null as it is set in rtl8192_usb_probe via the call
to usb_set_intfdata.

Detected by CoverityScan, CID#143078 ("Dereference after null check")

Fixes: 8fc8598e ("Staging: Added Realtek rtl8192u driver to staging")
Signed-off-by: default avatarColin Ian King <colin.king@canonical.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 83a95c16
......@@ -4957,20 +4957,18 @@ static void rtl8192_usb_disconnect(struct usb_interface *intf)
struct net_device *dev = usb_get_intfdata(intf);
struct r8192_priv *priv = ieee80211_priv(dev);
if (dev) {
unregister_netdev(dev);
RT_TRACE(COMP_DOWN,
"=============>wlan driver to be removed\n");
rtl8192_proc_remove_one(dev);
rtl8192_down(dev);
kfree(priv->pFirmware);
priv->pFirmware = NULL;
rtl8192_usb_deleteendpoints(dev);
usleep_range(10000, 11000);
}
unregister_netdev(dev);
RT_TRACE(COMP_DOWN, "=============>wlan driver to be removed\n");
rtl8192_proc_remove_one(dev);
rtl8192_down(dev);
kfree(priv->pFirmware);
priv->pFirmware = NULL;
rtl8192_usb_deleteendpoints(dev);
usleep_range(10000, 11000);
free_ieee80211(dev);
RT_TRACE(COMP_DOWN, "wlan driver removed\n");
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment