From: Denis Efremov Date: Thu, 26 Sep 2019 07:31:38 +0000 (+0300) Subject: staging: rtl8188eu: fix HighestRate check in odm_ARFBRefresh_8188E() X-Git-Tag: v3.16.80~130 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=584df56f99dd94362a24c4ed710239b8965d8791;p=thirdparty%2Fkernel%2Fstable.git staging: rtl8188eu: fix HighestRate check in odm_ARFBRefresh_8188E() commit 22d67a01d8d89552b989c9651419824bb4111200 upstream. 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: Michael Straube Signed-off-by: Denis Efremov Acked-by: Larry Finger Link: https://lore.kernel.org/r/20190926073138.12109-1-efremov@linux.com Signed-off-by: Greg Kroah-Hartman [bwh: Backported to 3.16: adjust filename, indentation] Signed-off-by: Ben Hutchings --- diff --git a/drivers/staging/rtl8188eu/hal/Hal8188ERateAdaptive.c b/drivers/staging/rtl8188eu/hal/Hal8188ERateAdaptive.c index dea220b507ad9..e9b82222fd4d6 100644 --- a/drivers/staging/rtl8188eu/hal/Hal8188ERateAdaptive.c +++ b/drivers/staging/rtl8188eu/hal/Hal8188ERateAdaptive.c @@ -403,7 +403,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;