Received: by 2002:a25:824b:0:0:0:0:0 with SMTP id d11csp1864338ybn; Thu, 26 Sep 2019 03:24:44 -0700 (PDT) X-Google-Smtp-Source: APXvYqxJO6dV5abDRg1Ne//ok6l/2YxXdy2yNElLtXpce5yEoCVVOTVsl8J5lvoOXS15UuTXm3Ux X-Received: by 2002:a50:e718:: with SMTP id a24mr2662023edn.289.1569493484294; Thu, 26 Sep 2019 03:24:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1569493484; cv=none; d=google.com; s=arc-20160816; b=Cmmh8o+XkM8/Yvn4kJpiLWt2XifJCf32FrYOLZK79rQLJENzHUC35Il09rvp1HecjZ WImpVYGvuclpswpujyUNanfT6dy+KEXnsqXDM+gzxC9tkZdWTtj+lEa+ihRzdJTYyNHG KNMqkKSab2aPrZb2aCQtOxsb/jqp+RVdwsbCYMHhZ3GssJtjAvGrjQHLyjaonNkyjmCt 7EU1ru+6MaBNXZpLIZViSXAzABcxBkw7ZT/WNNTeEYNiW5uUfT4qJutYjVBNQDpF3YqG CGOk8S5bLBq6DpCejsh/4FfpbOoAE1h/AW9VFdyOwcc2vussnhU3gihe0o5SeTH+u+6r 35Wg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=l//Gs0c7u01pz7zaVnzd0AwQx7M2oEVS4q0mnEANanc=; b=Xe1c4uLRHAZdWg+S2UFHe5XJH1zGL7Qd6WOULKjdMBR5H47ARFSixGHyxGgy2ZbNbB IE/hyuCuunZZnMjUs5pw8U4s0bbdDjJXXEA6JpCaI3oxGRpxB339UT1nlcBOjMwK7vkZ Rbj+QY5cxnCcFX0GDUY6Zb9LlIfP+FaAjg9lP2Jqpj4Rs6wTI7yAgnLaFs3sFZNqiMMq mVIWgHbwoYXbhjH/YstqlBoYblQy8qJ18GVaRiRLY5tNwN6TblH6ALo0kzJjIdlSHKaJ KlU+KFtJfxQ0/5qNWFbNC1tMm2f/QNFmox/z7AWv0l539CnMVwBZkLiwhZ5BqdIpJGKZ cLWA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id g90si1053651edd.329.2019.09.26.03.24.20; Thu, 26 Sep 2019 03:24:44 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729606AbfIZHbx (ORCPT + 99 others); Thu, 26 Sep 2019 03:31:53 -0400 Received: from mail-pg1-f195.google.com ([209.85.215.195]:45677 "EHLO mail-pg1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729451AbfIZHbx (ORCPT ); Thu, 26 Sep 2019 03:31:53 -0400 Received: by mail-pg1-f195.google.com with SMTP id q7so1034513pgi.12; Thu, 26 Sep 2019 00:31:53 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=l//Gs0c7u01pz7zaVnzd0AwQx7M2oEVS4q0mnEANanc=; b=NMM1H4ErcjMpnXMzEEKmFufNPSy2l88ypgYTBaYByxbB6z5dwwHVMnsiOpd9fUV8Cy 101bf2q5egtTVsmcxs0y1UiA+b4uLMmtBXm/zE6JQcn24BxsGwK2rQ4rF/N3q1Rs2N2f IDQVH3yxxxsCfJ/f8QnS74kmVeVwkxTxu5Q9zTVucw1Eg7WXGCg59B2aqufWJgb6nffv mQ5eTPkvYkOIyjJ6WPzwYqXVFBKiYTMq3shp+ozAoWze5YLxxGvIo/WeGFmMws2mu/7T Jr7cV++Q/rFDAyFdn45sMC185B4JLQAZvkQ2PdBSpMb0Rdhc+3SRiR2Bl6PxW3Wvckzd z3xA== X-Gm-Message-State: APjAAAXxVLjScGgAwIYqY7Y+dHy7ehlRqOWrcPcKSr7tI3zzCrPmJKQM jCEh2tPufFwkgRB91V8Ea4k= X-Received: by 2002:a17:90a:236f:: with SMTP id f102mr2087877pje.130.1569483112674; Thu, 26 Sep 2019 00:31:52 -0700 (PDT) Received: from black.wifi.public.euroopa.ee (99-48-196-88.sta.estpak.ee. [88.196.48.99]) by smtp.googlemail.com with ESMTPSA id u31sm3092013pgn.93.2019.09.26.00.31.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 26 Sep 2019 00:31:51 -0700 (PDT) From: Denis Efremov To: devel@driverdev.osuosl.org Cc: Denis Efremov , linux-kernel@vger.kernel.org, Larry Finger , Greg Kroah-Hartman , Michael Straube , stable@vger.kernel.org Subject: [PATCH] staging: rtl8188eu: fix HighestRate check in odm_ARFBRefresh_8188E() Date: Thu, 26 Sep 2019 10:31:38 +0300 Message-Id: <20190926073138.12109-1-efremov@linux.com> X-Mailer: git-send-email 2.21.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 Cc: Greg Kroah-Hartman Cc: Michael Straube Cc: stable@vger.kernel.org Signed-off-by: Denis Efremov --- 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