staging: rtl8188eu: increment placed into for loop header
authorIvan Safonov <insafonov@gmail.com>
Tue, 27 Oct 2015 15:24:24 +0000 (22:24 +0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 29 Oct 2015 00:09:08 +0000 (09:09 +0900)
The increment at the end of the cycle, and it can be placed in the loop header.

Signed-off-by: Ivan Safonov <insafonov@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/rtl8188eu/core/rtw_mlme_ext.c

index 4e6f1a87d625a2d67b49837ab3664b9736658b89..d900546b672f012da6dc31c24c4a5a465effadc6 100644 (file)
@@ -1181,7 +1181,7 @@ static void issue_assocreq(struct adapter *padapter)
        }
 
        /* vendor specific IE, such as WPA, WMM, WPS */
-       for (i = sizeof(struct ndis_802_11_fixed_ie); i < pmlmeinfo->network.IELength;) {
+       for (i = sizeof(struct ndis_802_11_fixed_ie); i < pmlmeinfo->network.IELength; i += (pIE->Length + 2)) {
                pIE = (struct ndis_802_11_var_ie *)(pmlmeinfo->network.IEs + i);
 
                switch (pIE->ElementID) {
@@ -1202,7 +1202,6 @@ static void issue_assocreq(struct adapter *padapter)
                default:
                        break;
                }
-               i += (pIE->Length + 2);
        }
 
        if (pmlmeinfo->assoc_AP_vendor == HT_IOT_PEER_REALTEK)