From: Jes Sorensen Date: Sat, 26 Apr 2014 16:54:52 +0000 (+0200) Subject: staging: rtl8723au: process_80211d(): Fix order of advancing array pos X-Git-Tag: firefly_0821_release~176^2~3465^2~39^2~1222 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=17979959ba5602d7acaa5c0f93a92c534ad4724d;p=firefly-linux-kernel-4.4.55.git staging: rtl8723au: process_80211d(): Fix order of advancing array pos Fix smatch warning from advancing array index before reading out the value of the array. Reported-by: Dan Carpenter Signed-off-by: Jes Sorensen Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/staging/rtl8723au/core/rtw_mlme_ext.c b/drivers/staging/rtl8723au/core/rtw_mlme_ext.c index e49170b3bb7a..00a7a63f960c 100644 --- a/drivers/staging/rtl8723au/core/rtw_mlme_ext.c +++ b/drivers/staging/rtl8723au/core/rtw_mlme_ext.c @@ -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';