staging: rtl8188eu: Skip unnecessary field checks
authorAymen Qader <qader.aymen@gmail.com>
Thu, 27 Sep 2018 21:19:11 +0000 (22:19 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 28 Sep 2018 12:30:52 +0000 (14:30 +0200)
Skip unnecessary request field checks when the information element
pointer is null.

Signed-off-by: Aymen Qader <qader.aymen@gmail.com>
ACKed-by: Larry Finger <Larry.Finger@lwfinger.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/rtl8188eu/core/rtw_mlme_ext.c

index 834053a..4d55bbd 100644 (file)
@@ -2971,11 +2971,11 @@ static unsigned int OnAssocReq(struct adapter *padapter,
        /*  checking SSID */
        p = rtw_get_ie(pframe + WLAN_HDR_A3_LEN + ie_offset, _SSID_IE_, &ie_len,
                pkt_len - WLAN_HDR_A3_LEN - ie_offset);
-       if (!p)
-               status = _STATS_FAILURE_;
 
-       if (ie_len == 0) { /*  broadcast ssid, however it is not allowed in assocreq */
+       if (!p || ie_len == 0) {
+               /*  broadcast ssid, however it is not allowed in assocreq */
                status = _STATS_FAILURE_;
+               goto OnAssocReqFail;
        } else {
                /*  check if ssid match */
                if (memcmp((void *)(p+2), cur->Ssid.Ssid, cur->Ssid.SsidLength))