Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp485170ybi; Thu, 11 Jul 2019 23:22:01 -0700 (PDT) X-Google-Smtp-Source: APXvYqy38XzGZ31b+EG1fsVUy45otOpPjwuB+LcbaB+KQw/3ZhQC82clVdYN+AKlJ4G96DDgfVDe X-Received: by 2002:a63:10a:: with SMTP id 10mr8977654pgb.281.1562912521343; 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=fk5ZQV691gzEJWSbGzE86SVkF/vPk4HB+lWa0N/sViD+iExLMjT3S6QeFy/FqsioTd YvSZxEE4cCREaX3VScavXNXsyJJ/DD2EcqW2tWs2RE0TG8OKeMmRDUm4GDW3ZffRRpLF q8yLLAJHV4Ezv8PTsdLIJnLeQFLy1C9H0QR42I5hMmPKF/JcmmAuFTTC5savoL/eDsRg 3f1xiwWq877eMt5ejMJaVCquw7gwvbq7LKdyjjn0WUyS/h5LsYEICj2wqnfg/tquqqjY 31XM908I2LUm4kmMsFNnZv3SNWAES2L1I2zbKy2Ns6OyucGLScPSwZ0KnsP6mmQgEMKg 8iRQ== 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=23LjpPgN5F8cAOkx1vRlBymaEP8nqi+hNZgyezn4g1o=; b=lWMNiSR+DGCmqxQ+5bOVDMIzmYfSoqCHbdgH4UnEdavEDVpYqMsGkQVi9xC7FnT9nw WAAdsJ51Ic0NBeGGWqdhWl+fQ0DjSjAN4jDcWf/wArVEc9zIMR8BbmfDNFU9Qiqe/KP/ WcvGTPTM/Zjmmc8scvK9r4fup0K9/WTO22zfqtRo87uW6zjxCGvomiptQY5SAfKKHxg3 ekJeEt0P5VmgSCwes6uyjhQUsTx+D2CXBLpf6LF6NIkBSUFy+EyxykLA69otJcWNJiFo MBRIfLXbxblbmcEGvG4BWT02oqyle6sMs2TY28HO29OI98CQMCTJHaOB2hg7n73Hc6LD 3Y5Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@nbd.name header.s=20160729 header.b=tJT+3Dtu; 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 q2si7329286pgh.177.2019.07.11.23.21.45; 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=tJT+3Dtu; 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 S1726072AbfGLGUs (ORCPT + 99 others); Fri, 12 Jul 2019 02:20:48 -0400 Received: from nbd.name ([46.4.11.11]:33148 "EHLO nbd.name" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726043AbfGLGUr (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=23LjpPgN5F8cAOkx1vRlBymaEP8nqi+hNZgyezn4g1o=; b=tJT+3DtuiJ4ae2uiCy9Dp/XU5f mO70B76/yMdOH+hKDojwZOrUCulHeSZg3IKszAkgjgojtYYqz78PvHfXzT2dzmHK8jBs93t6VDPzb KMuYUHH9i89rgC+RZg4o3R1OxTHvqRANpPyeN2Uqnnz1w+zjGnkUMKcxc4NMDGCQG0BE=; 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-0003rd-BI for linux-wireless@vger.kernel.org; Fri, 12 Jul 2019 08:20:46 +0200 Received: by maeck-3.local (Postfix, from userid 501) id 9C7F961C52AA; Fri, 12 Jul 2019 08:20:45 +0200 (CEST) From: Felix Fietkau To: linux-wireless@vger.kernel.org Subject: [PATCH 3/4] mt76: mt7615: fix invalid fallback rates Date: Fri, 12 Jul 2019 08:20:44 +0200 Message-Id: <20190712062045.85109-3-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/mt7615/mac.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/net/wireless/mediatek/mt76/mt7615/mac.c b/drivers/net/wireless/mediatek/mt76/mt7615/mac.c index fc98dabed594..b3e8ee06a783 100644 --- a/drivers/net/wireless/mediatek/mt76/mt7615/mac.c +++ b/drivers/net/wireless/mediatek/mt76/mt7615/mac.c @@ -503,6 +503,9 @@ void mt7615_mac_set_rates(struct mt7615_dev *dev, struct mt7615_sta *sta, IEEE80211_TX_RC_160_MHZ_WIDTH)) continue; + if (!rates[i].idx) + continue; + rates[i].idx--; } -- 2.17.0