aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/staging
diff options
context:
space:
mode:
authorLarry Finger <Larry.Finger@lwfinger.net>2012-03-02 22:06:49 -0500
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2012-03-07 16:36:45 -0500
commitee6aeff71e2f16b9fe95ce908d098c169e0f4004 (patch)
treed06bd676fc8f5539284a6b3479f9de944c838d00 /drivers/staging
parentb76dee4a410c8c2732b2073bf9d280c1d16923ed (diff)
staging: r8712u: Fix Smatch warning
The patch 2080913e017a: "staging: r8712u: Fix regression caused by commit 8c213fa" from Feb 25, 2012, leads to the following Smatch complaint: drivers/staging/rtl8712/usb_intf.c:629 r871xu_dev_remove() warn: variable dereferenced before check 'padapter' (see line 625) The fix is to move the new statements inside the block where padapter is not NULL. Reported-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging')
-rw-r--r--drivers/staging/rtl8712/usb_intf.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/drivers/staging/rtl8712/usb_intf.c b/drivers/staging/rtl8712/usb_intf.c
index b0c4cdba222..e419b4fd82b 100644
--- a/drivers/staging/rtl8712/usb_intf.c
+++ b/drivers/staging/rtl8712/usb_intf.c
@@ -620,12 +620,12 @@ static void r871xu_dev_remove(struct usb_interface *pusb_intf)
620 struct _adapter *padapter = netdev_priv(pnetdev); 620 struct _adapter *padapter = netdev_priv(pnetdev);
621 struct usb_device *udev = interface_to_usbdev(pusb_intf); 621 struct usb_device *udev = interface_to_usbdev(pusb_intf);
622 622
623 if (padapter->fw_found)
624 release_firmware(padapter->fw);
625 /* never exit with a firmware callback pending */
626 wait_for_completion(&padapter->rtl8712_fw_ready);
627 usb_set_intfdata(pusb_intf, NULL); 623 usb_set_intfdata(pusb_intf, NULL);
628 if (padapter) { 624 if (padapter) {
625 if (padapter->fw_found)
626 release_firmware(padapter->fw);
627 /* never exit with a firmware callback pending */
628 wait_for_completion(&padapter->rtl8712_fw_ready);
629 if (drvpriv.drv_registered == true) 629 if (drvpriv.drv_registered == true)
630 padapter->bSurpriseRemoved = true; 630 padapter->bSurpriseRemoved = true;
631 if (pnetdev != NULL) { 631 if (pnetdev != NULL) {