packagegroup-opendreambox-essential: move to meta-opendreambox
[opendreambox.git] / meta-bsp / common / recipes / linux / linux-dreambox-3.2 / 0016-staging-r8712u-Fix-Smatch-warning.patch
1 From c1ca5ac16b4e651558a0c25befba89ff64843e20 Mon Sep 17 00:00:00 2001
2 From: Larry Finger <Larry.Finger@lwfinger.net>
3 Date: Fri, 2 Mar 2012 21:06:49 -0600
4 Subject: [PATCH 16/17] staging: r8712u: Fix Smatch warning
5
6 The patch 2080913e017a: "staging: r8712u: Fix regression caused by
7 commit 8c213fa" from Feb 25, 2012, leads to the following Smatch
8 complaint:
9
10 drivers/staging/rtl8712/usb_intf.c:629 r871xu_dev_remove()
11          warn: variable dereferenced before check 'padapter' (see line 625)
12
13 The fix is to move the new statements inside the block where padapter
14 is not NULL.
15
16 Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
17 Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
18 Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
19 (cherry picked from commit ee6aeff71e2f16b9fe95ce908d098c169e0f4004)
20 ---
21  drivers/staging/rtl8712/usb_intf.c | 8 ++++----
22  1 file changed, 4 insertions(+), 4 deletions(-)
23
24 diff --git a/drivers/staging/rtl8712/usb_intf.c b/drivers/staging/rtl8712/usb_intf.c
25 index 3a56fc1..aa82f4a 100644
26 --- a/drivers/staging/rtl8712/usb_intf.c
27 +++ b/drivers/staging/rtl8712/usb_intf.c
28 @@ -625,12 +625,12 @@ static void r871xu_dev_remove(struct usb_interface *pusb_intf)
29         struct _adapter *padapter = netdev_priv(pnetdev);
30         struct usb_device *udev = interface_to_usbdev(pusb_intf);
31  
32 -       if (padapter->fw_found)
33 -               release_firmware(padapter->fw);
34 -       /* never exit with a firmware callback pending */
35 -       wait_for_completion(&padapter->rtl8712_fw_ready);
36         usb_set_intfdata(pusb_intf, NULL);
37         if (padapter) {
38 +               if (padapter->fw_found)
39 +                       release_firmware(padapter->fw);
40 +               /* never exit with a firmware callback pending */
41 +               wait_for_completion(&padapter->rtl8712_fw_ready);
42                 if (drvpriv.drv_registered == true)
43                         padapter->bSurpriseRemoved = true;
44                 if (pnetdev != NULL) {
45 -- 
46 1.8.1.2
47