driverdev-devel.linuxdriverproject.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] staging: rtl8188eu: fix HighestRate check in odm_ARFBRefresh_8188E()
@ 2019-09-26  7:31 Denis Efremov
  2019-09-26 17:17 ` Larry Finger
  2019-09-27 13:19 ` Sasha Levin
  0 siblings, 2 replies; 3+ messages in thread
From: Denis Efremov @ 2019-09-26  7:31 UTC (permalink / raw)
  To: devel
  Cc: Greg Kroah-Hartman, linux-kernel, stable, Denis Efremov, Larry Finger

It's incorrect to compare HighestRate with 0x0b twice in the following
manner "if (HighestRate > 0x0b) ... else if (HighestRate > 0x0b) ...". The
"else if" branch is constantly false. The second comparision should be
with 0x03 according to the max_rate_idx in ODM_RAInfo_Init().

Cc: Larry Finger <Larry.Finger@lwfinger.net>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Michael Straube <straube.linux@gmail.com>
Cc: stable@vger.kernel.org
Signed-off-by: Denis Efremov <efremov@linux.com>
---
 drivers/staging/rtl8188eu/hal/hal8188e_rate_adaptive.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/rtl8188eu/hal/hal8188e_rate_adaptive.c b/drivers/staging/rtl8188eu/hal/hal8188e_rate_adaptive.c
index 9ddd51685063..5792f491b59a 100644
--- a/drivers/staging/rtl8188eu/hal/hal8188e_rate_adaptive.c
+++ b/drivers/staging/rtl8188eu/hal/hal8188e_rate_adaptive.c
@@ -409,7 +409,7 @@ static int odm_ARFBRefresh_8188E(struct odm_dm_struct *dm_odm, struct odm_ra_inf
 		pRaInfo->PTModeSS = 3;
 	else if (pRaInfo->HighestRate > 0x0b)
 		pRaInfo->PTModeSS = 2;
-	else if (pRaInfo->HighestRate > 0x0b)
+	else if (pRaInfo->HighestRate > 0x03)
 		pRaInfo->PTModeSS = 1;
 	else
 		pRaInfo->PTModeSS = 0;
-- 
2.21.0

_______________________________________________
devel mailing list
devel@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel

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

* Re: [PATCH] staging: rtl8188eu: fix HighestRate check in odm_ARFBRefresh_8188E()
  2019-09-26  7:31 [PATCH] staging: rtl8188eu: fix HighestRate check in odm_ARFBRefresh_8188E() Denis Efremov
@ 2019-09-26 17:17 ` Larry Finger
  2019-09-27 13:19 ` Sasha Levin
  1 sibling, 0 replies; 3+ messages in thread
From: Larry Finger @ 2019-09-26 17:17 UTC (permalink / raw)
  To: Denis Efremov, devel; +Cc: Greg Kroah-Hartman, linux-kernel, stable

On 9/26/19 2:31 AM, Denis Efremov wrote:
> It's incorrect to compare HighestRate with 0x0b twice in the following
> manner "if (HighestRate > 0x0b) ... else if (HighestRate > 0x0b) ...". The
> "else if" branch is constantly false. The second comparision should be
> with 0x03 according to the max_rate_idx in ODM_RAInfo_Init().
> 
> Cc: Larry Finger <Larry.Finger@lwfinger.net>
> Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
> Cc: Michael Straube <straube.linux@gmail.com>
> Cc: stable@vger.kernel.org
> Signed-off-by: Denis Efremov <efremov@linux.com>
> ---
>   drivers/staging/rtl8188eu/hal/hal8188e_rate_adaptive.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/staging/rtl8188eu/hal/hal8188e_rate_adaptive.c b/drivers/staging/rtl8188eu/hal/hal8188e_rate_adaptive.c
> index 9ddd51685063..5792f491b59a 100644
> --- a/drivers/staging/rtl8188eu/hal/hal8188e_rate_adaptive.c
> +++ b/drivers/staging/rtl8188eu/hal/hal8188e_rate_adaptive.c
> @@ -409,7 +409,7 @@ static int odm_ARFBRefresh_8188E(struct odm_dm_struct *dm_odm, struct odm_ra_inf
>   		pRaInfo->PTModeSS = 3;
>   	else if (pRaInfo->HighestRate > 0x0b)
>   		pRaInfo->PTModeSS = 2;
> -	else if (pRaInfo->HighestRate > 0x0b)
> +	else if (pRaInfo->HighestRate > 0x03)
>   		pRaInfo->PTModeSS = 1;
>   	else
>   		pRaInfo->PTModeSS = 0;
> 

I agree that the original code is wrong; however, I prefer that changes that 
alter the execution should be tested. I see no evidence that such testing has 
been done. It probably does not matter because a highest rate between 3 and 0xb 
means 802.11g is in use, and that may no longer be a real-world situation.

With any future patches, you need to indicate if testing has been done.

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

Larry

_______________________________________________
devel mailing list
devel@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel

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

* Re: [PATCH] staging: rtl8188eu: fix HighestRate check in odm_ARFBRefresh_8188E()
  2019-09-26  7:31 [PATCH] staging: rtl8188eu: fix HighestRate check in odm_ARFBRefresh_8188E() Denis Efremov
  2019-09-26 17:17 ` Larry Finger
@ 2019-09-27 13:19 ` Sasha Levin
  1 sibling, 0 replies; 3+ messages in thread
From: Sasha Levin @ 2019-09-27 13:19 UTC (permalink / raw)
  To: Sasha Levin, Denis Efremov, devel
  Cc: , Greg Kroah-Hartman, linux-kernel, Denis Efremov, stable, Larry Finger

Hi,

[This is an automated email]

This commit has been processed because it contains a -stable tag.
The stable tag indicates that it's relevant for the following trees: all

The bot has tested the following trees: v5.3.1, v5.2.17, v4.19.75, v4.14.146, v4.9.194, v4.4.194.

v5.3.1: Build OK!
v5.2.17: Build OK!
v4.19.75: Failed to apply! Possible dependencies:
    00585495c4fa ("staging: rtl8188eu: refactor SwLedControlMode1()")
    859df6aa0d97 ("staging: rtl8188eu: cleanup inconsistent indenting")

v4.14.146: Failed to apply! Possible dependencies:
    00585495c4fa ("staging: rtl8188eu: refactor SwLedControlMode1()")
    2742a7dddae4 ("Staging: rtl8188eu: core: Use __func__ instead of function name")
    35a53b9a37ca ("staging:rtl8188eu Fix remove semicolon in do {}while(0)")
    3cedbfb85199 ("staging: rtl8188eu: rename variable")
    515ce733e86e ("staging:r8188eu: Use lib80211 to encrypt (CCMP) tx frames")
    7de2258b5c71 ("staging: rtl8188eu: replace NULL comparison with variable")
    819fa2a0d749 ("staging: rtl8188eu: use __func__ instead of function name")
    859df6aa0d97 ("staging: rtl8188eu: cleanup inconsistent indenting")
    b677f4ecf6ac ("staging: rtl8188eu: Fix spelling")
    c5fe50aaa20c ("Revert "staging:r8188eu: Use lib80211 to encrypt (CCMP) tx frames"")
    ceefaaced11e ("staging:rtl8188eu Remove unneccessary parenthesis")
    e8d93aca1b23 ("Staging: rtl8188eu: core: Fix line over 80 characters")
    f3139e621429 ("staging: rtl8188eu: Place the constant on the right side in comparisons")

v4.9.194: Failed to apply! Possible dependencies:
    00585495c4fa ("staging: rtl8188eu: refactor SwLedControlMode1()")
    2091eda1f21d ("staging: rtl8188eu: Put constant on right side of comparison")
    2742a7dddae4 ("Staging: rtl8188eu: core: Use __func__ instead of function name")
    35abf582a537 ("staging:r8188eu: replace rx_end member of recv_frame with pkt->end")
    3cedbfb85199 ("staging: rtl8188eu: rename variable")
    515ce733e86e ("staging:r8188eu: Use lib80211 to encrypt (CCMP) tx frames")
    7d2af82cc5f5 ("staging: rtl8188eu: In core directory, fixed 'missing a balnk line after declarations' warnings.")
    7de2258b5c71 ("staging: rtl8188eu: replace NULL comparison with variable")
    80c96e08c416 ("staging:r8188eu: remove unused WIFI_MP_*STATE and WIFI_MP_CTX* definitions")
    819fa2a0d749 ("staging: rtl8188eu: use __func__ instead of function name")
    859df6aa0d97 ("staging: rtl8188eu: cleanup inconsistent indenting")
    b677f4ecf6ac ("staging: rtl8188eu: Fix spelling")
    bb5cd2e531c0 ("staging:r8188eu: remove rtw_os_recv_resource_alloc function")
    c10364e1f4f6 ("staging: rtl8188eu: core: removes unecessary parenthesis")
    c5fe50aaa20c ("Revert "staging:r8188eu: Use lib80211 to encrypt (CCMP) tx frames"")
    cd30a3924932 ("staging:r8188eu: refactor recvbuf2recvframe function")
    dd2aa2501c92 ("staging: rtl8188eu: core: fixes tabstop alignment")
    de109778e7cf ("staging: rtl8188eu: Fix block comments warning")
    df47a14c2c8b ("staging:r8188eu: replace recv_frame->rx_(data|len|tail) with pkt->(data|len|tail) and remove unused recvframe_(put|pull|pull_tail)()")
    e038e67f0891 ("staging:r8188eu: update pkt->(data|tail|len) synchronously with rx_(data|tail|len) in recv_frame structure")
    e8d93aca1b23 ("Staging: rtl8188eu: core: Fix line over 80 characters")
    f3139e621429 ("staging: rtl8188eu: Place the constant on the right side in comparisons")

v4.4.194: Failed to apply! Possible dependencies:
    00585495c4fa ("staging: rtl8188eu: refactor SwLedControlMode1()")
    139737983db4 ("staging: rtl8188eu: Remove unnecessary pointer cast")
    2742a7dddae4 ("Staging: rtl8188eu: core: Use __func__ instead of function name")
    35abf582a537 ("staging:r8188eu: replace rx_end member of recv_frame with pkt->end")
    3cedbfb85199 ("staging: rtl8188eu: rename variable")
    515ce733e86e ("staging:r8188eu: Use lib80211 to encrypt (CCMP) tx frames")
    7a1586353b97 ("rtl8188eu: Add spaces around arithmetic operators")
    7b170bacbb13 ("staging: rtl8188eu: core: rtw_xmit: Use macros instead of constants")
    7d2af82cc5f5 ("staging: rtl8188eu: In core directory, fixed 'missing a balnk line after declarations' warnings.")
    7d7be350073e ("staging: rtl8188eu: core: rtw_xmit: Move constant of the right side")
    7de2258b5c71 ("staging: rtl8188eu: replace NULL comparison with variable")
    80c96e08c416 ("staging:r8188eu: remove unused WIFI_MP_*STATE and WIFI_MP_CTX* definitions")
    859df6aa0d97 ("staging: rtl8188eu: cleanup inconsistent indenting")
    8891bcac17da ("staging: rtl8188eu: add spaces around binary '*'")
    b677f4ecf6ac ("staging: rtl8188eu: Fix spelling")
    bb5cd2e531c0 ("staging:r8188eu: remove rtw_os_recv_resource_alloc function")
    bbfe286b07d8 ("staging: r8188eu: replace rtw_ieee80211_hdr_3addr with ieee80211_hdr_3addr")
    c10364e1f4f6 ("staging: rtl8188eu: core: removes unecessary parenthesis")
    c5fe50aaa20c ("Revert "staging:r8188eu: Use lib80211 to encrypt (CCMP) tx frames"")
    c60298c5869c ("staging: rtl8188eu: core: Replace memcpy() with ether_addr_copy() if ethernet addresses are __aligned(2)")
    d0beccb04e96 ("staging: rtl8188eu: don't cast to void* when calling memset()")
    dd2aa2501c92 ("staging: rtl8188eu: core: fixes tabstop alignment")
    de109778e7cf ("staging: rtl8188eu: Fix block comments warning")
    df47a14c2c8b ("staging:r8188eu: replace recv_frame->rx_(data|len|tail) with pkt->(data|len|tail) and remove unused recvframe_(put|pull|pull_tail)()")
    e038e67f0891 ("staging:r8188eu: update pkt->(data|tail|len) synchronously with rx_(data|tail|len) in recv_frame structure")
    e8d93aca1b23 ("Staging: rtl8188eu: core: Fix line over 80 characters")
    f3139e621429 ("staging: rtl8188eu: Place the constant on the right side in comparisons")


NOTE: The patch will not be queued to stable trees until it is upstream.

How should we proceed with this patch?

--
Thanks,
Sasha
_______________________________________________
devel mailing list
devel@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel

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

end of thread, other threads:[~2019-09-27 13:20 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-09-26  7:31 [PATCH] staging: rtl8188eu: fix HighestRate check in odm_ARFBRefresh_8188E() Denis Efremov
2019-09-26 17:17 ` Larry Finger
2019-09-27 13:19 ` Sasha Levin

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