* [PATCH] staging: rtl8723bs: Skip unnecessary field checks
@ 2018-09-27 22:28 Aymen Qader
0 siblings, 0 replies; only message in thread
From: Aymen Qader @ 2018-09-27 22:28 UTC (permalink / raw)
Cc: Larry Finger, Bastien Nocera, Hans de Goede, Aymen Qader,
Greg Kroah-Hartman, devel, linux-kernel
Skip unnecessary request field checks when the information element
pointer is null.
Signed-off-by: Aymen Qader <qader.aymen@gmail.com>
---
drivers/staging/rtl8723bs/core/rtw_mlme_ext.c | 9 ++++-----
1 file changed, 4 insertions(+), 5 deletions(-)
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_;
--
2.17.1
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2018-09-27 22:28 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-09-27 22:28 [PATCH] staging: rtl8723bs: Skip unnecessary field checks Aymen Qader
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).