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,11 +4957,9 @@ static void rtl8192_usb_disconnect(struct usb_interface *intf) ...@@ -4957,11 +4957,9 @@ static void rtl8192_usb_disconnect(struct usb_interface *intf)
struct net_device *dev = usb_get_intfdata(intf); struct net_device *dev = usb_get_intfdata(intf);
struct r8192_priv *priv = ieee80211_priv(dev); struct r8192_priv *priv = ieee80211_priv(dev);
if (dev) {
unregister_netdev(dev); unregister_netdev(dev);
RT_TRACE(COMP_DOWN, RT_TRACE(COMP_DOWN, "=============>wlan driver to be removed\n");
"=============>wlan driver to be removed\n");
rtl8192_proc_remove_one(dev); rtl8192_proc_remove_one(dev);
rtl8192_down(dev); rtl8192_down(dev);
...@@ -4969,8 +4967,8 @@ static void rtl8192_usb_disconnect(struct usb_interface *intf) ...@@ -4969,8 +4967,8 @@ static void rtl8192_usb_disconnect(struct usb_interface *intf)
priv->pFirmware = NULL; priv->pFirmware = NULL;
rtl8192_usb_deleteendpoints(dev); rtl8192_usb_deleteendpoints(dev);
usleep_range(10000, 11000); usleep_range(10000, 11000);
}
free_ieee80211(dev); free_ieee80211(dev);
RT_TRACE(COMP_DOWN, "wlan driver removed\n"); 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