From: Aymen Qader Date: Thu, 27 Sep 2018 22:28:14 +0000 (+0100) Subject: staging: rtl8723bs: Skip unnecessary field checks X-Git-Tag: microblaze-v5.0-rc1~82^2~243 X-Git-Url: http://git.monstr.eu/?a=commitdiff_plain;h=6493a78f80384e3542a040b4fd07f01a280d1cf4;p=linux-2.6-microblaze.git staging: rtl8723bs: Skip unnecessary field checks Skip unnecessary request field checks when the information element pointer is null. Signed-off-by: Aymen Qader Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/staging/rtl8723bs/core/rtw_mlme_ext.c b/drivers/staging/rtl8723bs/core/rtw_mlme_ext.c index bf055935ef65..69c7abc0e3a5 100644 --- a/drivers/staging/rtl8723bs/core/rtw_mlme_ext.c +++ b/drivers/staging/rtl8723bs/core/rtw_mlme_ext.c @@ -1267,13 +1267,12 @@ unsigned int OnAssocReq(struct adapter *padapter, union recv_frame *precv_frame) /* 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 == NULL) { - 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_; - else { + goto OnAssocReqFail; + } else { /* check if ssid match */ if (memcmp((void *)(p+2), cur->Ssid.Ssid, cur->Ssid.SsidLength)) status = _STATS_FAILURE_;