staging: rtl8723au: rtw_cfg80211_inform_bss() fix Smatch warning
authorJes Sorensen <Jes.Sorensen@redhat.com>
Sat, 26 Apr 2014 16:54:55 +0000 (18:54 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 26 Apr 2014 17:16:12 +0000 (10:16 -0700)
Check the size of pnetwork->network.IELenght correctly to avoid Smatch
warning.

Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/rtl8723au/os_dep/ioctl_cfg80211.c

index 5dbe3f43ab0e8e57d9ed24b992248740d9880e95..74ac86a0333f9305a901f7c113f90244c1c54533 100644 (file)
@@ -260,7 +260,7 @@ static int rtw_cfg80211_inform_bss(struct rtw_adapter *padapter,
        size_t notify_ielen;
        s32 notify_signal;
        u8 buf[MAX_BSSINFO_LEN], *pbuf;
-       size_t len, bssinf_len = 0;
+       size_t len;
        struct ieee80211_hdr *pwlanhdr;
        unsigned short *fctrl;
 
@@ -270,11 +270,9 @@ static int rtw_cfg80211_inform_bss(struct rtw_adapter *padapter,
 
        /* DBG_8723A("%s\n", __func__); */
 
-       bssinf_len =
-               pnetwork->network.IELength + sizeof(struct ieee80211_hdr_3addr);
-       if (bssinf_len > MAX_BSSINFO_LEN) {
+       if (pnetwork->network.IELength > MAX_IE_SZ) {
                DBG_8723A("%s IE Length too long > %d byte\n", __func__,
-                         MAX_BSSINFO_LEN);
+                         MAX_IE_SZ);
                goto exit;
        }