[<prev] [next>] [day] [month] [year] [list]
Date: Fri, 02 Mar 2012 21:06:49 -0600
From: Larry Finger <Larry.Finger@...inger.net>
To: Greg Kroah-Hartman <gregkh@...ux-foundation.org>
Cc: dan.carpenter@...cle.com, devel@...verdev.osuosl.org,
linux-kernel@...r.kernel.org
Subject: [PATCH] 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@...cle.com>
Signed-off-by: Larry Finger <Larry.Finger@...inger.net>
---
Index: staging/drivers/staging/rtl8712/usb_intf.c
===================================================================
--- staging.orig/drivers/staging/rtl8712/usb_intf.c
+++ staging/drivers/staging/rtl8712/usb_intf.c
@@ -620,12 +620,12 @@ static void r871xu_dev_remove(struct usb
struct _adapter *padapter = netdev_priv(pnetdev);
struct usb_device *udev = interface_to_usbdev(pusb_intf);
- if (padapter->fw_found)
- release_firmware(padapter->fw);
- /* never exit with a firmware callback pending */
- wait_for_completion(&padapter->rtl8712_fw_ready);
usb_set_intfdata(pusb_intf, NULL);
if (padapter) {
+ if (padapter->fw_found)
+ release_firmware(padapter->fw);
+ /* never exit with a firmware callback pending */
+ wait_for_completion(&padapter->rtl8712_fw_ready);
if (drvpriv.drv_registered == true)
padapter->bSurpriseRemoved = true;
if (pnetdev != NULL) {
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists