]> git.karo-electronics.de Git - linux-beck.git/commitdiff
staging: rtl8723au: process_80211d(): Fix order of advancing array pos
authorJes Sorensen <Jes.Sorensen@redhat.com>
Sat, 26 Apr 2014 16:54:52 +0000 (18:54 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 26 Apr 2014 17:16:12 +0000 (10:16 -0700)
Fix smatch warning from advancing array index before reading out the
value of the array.

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/core/rtw_mlme_ext.c

index e49170b3bb7a5d0b6910858010421e0dec86dfbf..00a7a63f960c7ef9ce8d6e1a58155e9ecda0d6cb 100644 (file)
@@ -4867,9 +4867,9 @@ static void process_80211d(struct rtw_adapter *padapter,
                if (!ie || ie[1] < IEEE80211_COUNTRY_IE_MIN_LEN)
                        return;
 
-               ie += 2;
-               p = ie;
+               p = ie + 2;
                ie += ie[1];
+               ie += 2;
 
                memcpy(country, p, 3);
                country[3] = '\0';