From 17979959ba5602d7acaa5c0f93a92c534ad4724d Mon Sep 17 00:00:00 2001 From: Jes Sorensen Date: Sat, 26 Apr 2014 18:54:52 +0200 Subject: [PATCH] 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 --- drivers/staging/rtl8723au/core/rtw_mlme_ext.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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';