linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2] staging: rtl8188eu: Skip unnecessary field checks
@ 2018-09-27 21:19 Aymen Qader
  2018-09-27 22:04 ` Larry Finger
  0 siblings, 1 reply; 2+ messages in thread
From: Aymen Qader @ 2018-09-27 21:19 UTC (permalink / raw)
  To: Larry Finger; +Cc: 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>
---
v2: combine pointer check and length check & change commit message to be
more appropriate

 drivers/staging/rtl8188eu/core/rtw_mlme_ext.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/staging/rtl8188eu/core/rtw_mlme_ext.c b/drivers/staging/rtl8188eu/core/rtw_mlme_ext.c
index 834053a0ae9d..4d55bbdf8fb7 100644
--- a/drivers/staging/rtl8188eu/core/rtw_mlme_ext.c
+++ b/drivers/staging/rtl8188eu/core/rtw_mlme_ext.c
@@ -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))
-- 
2.17.1


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH v2] staging: rtl8188eu: Skip unnecessary field checks
  2018-09-27 21:19 [PATCH v2] staging: rtl8188eu: Skip unnecessary field checks Aymen Qader
@ 2018-09-27 22:04 ` Larry Finger
  0 siblings, 0 replies; 2+ messages in thread
From: Larry Finger @ 2018-09-27 22:04 UTC (permalink / raw)
  To: Aymen Qader; +Cc: Greg Kroah-Hartman, devel, linux-kernel

On 9/27/18 4:19 PM, Aymen Qader wrote:
> Skip unnecessary request field checks when the information element
> pointer is null.
> 
> Signed-off-by: Aymen Qader <qader.aymen@gmail.com>
> ---
> v2: combine pointer check and length check & change commit message to be
> more appropriate
> 
>   drivers/staging/rtl8188eu/core/rtw_mlme_ext.c | 6 +++---
>   1 file changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/staging/rtl8188eu/core/rtw_mlme_ext.c b/drivers/staging/rtl8188eu/core/rtw_mlme_ext.c
> index 834053a0ae9d..4d55bbdf8fb7 100644
> --- a/drivers/staging/rtl8188eu/core/rtw_mlme_ext.c
> +++ b/drivers/staging/rtl8188eu/core/rtw_mlme_ext.c
> @@ -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))
> 

ACKed-by: Larry Finger <Larry.Finger@lwfinger.net>



^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2018-09-27 22:04 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-09-27 21:19 [PATCH v2] staging: rtl8188eu: Skip unnecessary field checks Aymen Qader
2018-09-27 22:04 ` Larry Finger

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).