Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp485165ybi; Thu, 11 Jul 2019 23:22:01 -0700 (PDT) X-Google-Smtp-Source: APXvYqz0Rqg+ztUxeB2SJI34ho4z7Gr5tek94TZ2kzsizJ5HOoxMzaHauO9cZ+mTQuuf374Bh/dj X-Received: by 2002:a17:90a:1b4c:: with SMTP id q70mr9340304pjq.69.1562912521339; Thu, 11 Jul 2019 23:22:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1562912521; cv=none; d=google.com; s=arc-20160816; b=TwG6soCUXh+b7ZP2y8i72JlTW6R1dAEcPfj5N+a3vEh3g+qqs2FnTYdBnJbYro7Wq0 HfT9sPEXyHci94n3Ih3Ijk2/byDGstapQOPULD9zlgJBosYbrwsQh4BaSt8bk+86+JYN 96f7B+2/Z/lPiGHS+Z7sfYTrvppMVwP/vSl3x31Kv7eKCUt7wTyynb1A1sor9zBA/a/K fP1nosoFT0qL3yrebppm3wUK/X+ZEVKV3/AuAPLJCRLaNnAKbRtzmrYLy+P6xGtf8WP/ s/0aCg54cQC/w2D2LdODk+IRgkKPRIqDsBzI8RJdFjiJcKgLIPSkRmuHwrx+e2nFzmBl W8yA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:to:from:dkim-signature; bh=JE+/VAawot01kSJmz9PUrzUg3MB64OvpCpOfFaOzMCY=; b=RVaidMXIYqv8Y/HE1MLA+buY3AaG7MIrRZE6Yf4rw1fvMlwhklynvbitQzL1MLrKRX uLIIFnBPiFUmyLgCky1QfaEET6WsopOLNxS4SLVdT44IgrWA2x16YNwpHse20veuNC6W stRXfc/gleK9b4oGsiHWotBhhflM+S3Q5HvRDD3uCRSjdIh4zkatkEK4CTavXHKfM1s0 WJEzkq9hi2cObTnCvE9sNt0lknhTUbeJQ3ilnA+6xVUp3Ik3rfOzc0nRvNl7gCOkusU+ bzxA2KYyFZlvdzmbioL5rzvBg3tp6EDAGiTmHcdgSwG1XwXKsTJkvlqlTw8CxtB2gh2x TuxA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@nbd.name header.s=20160729 header.b=RqhAoK8B; spf=pass (google.com: best guess record for domain of linux-wireless-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-wireless-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 c70si7892757pfc.270.2019.07.11.23.21.46; Thu, 11 Jul 2019 23:22:01 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-wireless-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=fail header.i=@nbd.name header.s=20160729 header.b=RqhAoK8B; spf=pass (google.com: best guess record for domain of linux-wireless-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726070AbfGLGUs (ORCPT + 99 others); Fri, 12 Jul 2019 02:20:48 -0400 Received: from nbd.name ([46.4.11.11]:33142 "EHLO nbd.name" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725791AbfGLGUr (ORCPT ); Fri, 12 Jul 2019 02:20:47 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=nbd.name; s=20160729; h=References:In-Reply-To:Message-Id:Date:Subject:To:From:Sender: Reply-To:Cc:MIME-Version:Content-Type:Content-Transfer-Encoding:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=JE+/VAawot01kSJmz9PUrzUg3MB64OvpCpOfFaOzMCY=; b=RqhAoK8BiBFoEo1sBEqk7tCi+I UYtSU8C2KgjfD3ODjrjCwfhO0RhzvA4hb9Ytu3KHUk4HEOfkZBoyeQovpeFGpaGdgSyfQumYWkZ90 D5WLCOz1gaIVUT3dv+3FcFwfuaW7xH6F7mUp0pE6ZLLdElfSBiMGO1mjtSelTJgSdZXw=; Received: from p54ae9abd.dip0.t-ipconnect.de ([84.174.154.189] helo=maeck-3.local) by ds12 with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1hlovG-0003ra-96 for linux-wireless@vger.kernel.org; Fri, 12 Jul 2019 08:20:46 +0200 Received: by maeck-3.local (Postfix, from userid 501) id A1F4461C52AD; Fri, 12 Jul 2019 08:20:45 +0200 (CEST) From: Felix Fietkau To: linux-wireless@vger.kernel.org Subject: [PATCH 4/4] mt76: mt7603: fix invalid fallback rates Date: Fri, 12 Jul 2019 08:20:45 +0200 Message-Id: <20190712062045.85109-4-nbd@nbd.name> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20190712062045.85109-1-nbd@nbd.name> References: <20190712062045.85109-1-nbd@nbd.name> Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org Only decrement the rate index on duplicate rates if it is not already 0 Signed-off-by: Felix Fietkau --- drivers/net/wireless/mediatek/mt76/mt7603/mac.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/net/wireless/mediatek/mt76/mt7603/mac.c b/drivers/net/wireless/mediatek/mt76/mt7603/mac.c index 40db1cbc832d..81fb4276e742 100644 --- a/drivers/net/wireless/mediatek/mt76/mt7603/mac.c +++ b/drivers/net/wireless/mediatek/mt76/mt7603/mac.c @@ -639,6 +639,9 @@ void mt7603_wtbl_set_rates(struct mt7603_dev *dev, struct mt7603_sta *sta, IEEE80211_TX_RC_40_MHZ_WIDTH) continue; + if (!rates[i].idx) + continue; + rates[i].idx--; } -- 2.17.0