Received: by 2002:a05:6a10:16a7:0:0:0:0 with SMTP id gp39csp572565pxb; Wed, 11 Nov 2020 10:34:59 -0800 (PST) X-Google-Smtp-Source: ABdhPJwIvjdWUujzbaLMjMjbajK4dgJJiE4LkGrOzbD9pqo0enMnV8B5vjQ+L0j28fmIhTrQiwoe X-Received: by 2002:a17:906:f1d8:: with SMTP id gx24mr26314018ejb.73.1605119699191; Wed, 11 Nov 2020 10:34:59 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1605119699; cv=none; d=google.com; s=arc-20160816; b=tuZYK2+Bk9WtOsBoorfBpdigOtvSwCGfE4zLs6yhKX9ld2iTeqFPu+gXQIj/ySkaJU VJdVwUWLsKoOMtXUbTZoHeplf30BwB1tyZ0Qkl1JcW4y00xAlsyoxBXBkCgODzwtgFQo yszBD8+GDTct6kgu84XI9bs5uNjom0NZu6A92I9p8c4wEWaK9uc8Z+Un1kO8pR27TNKd IH3nXqyAvuhYCezIy8BaYTrFH9Onh+iLXZG6uo8yH6P0H5LA+L6z+DnRwrJNtWIb8HFX THU+nWAj/C8Iiv+dBkKqOG6SnAG29bsh10n9n0W7xcyj/qmJAHSKEy+BsVuOvlEDFbQB NfPw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=mUQJj/5A6aqLOlEFlwB9HFVaFwNXf6zvmBqCM09Y7ww=; b=vOQiBne3aLHniO8soSq9IPFCS0vJjNi2VhgRDjY0hBUboveT+qeByknCL7gPho/lEf QpmeDrPZ0moeFw/3BsaR23Rl88BUuLjDNuW8rBgKfbI+6A0uMJ8eGK+x0oAOYFkQNhLD TklO3X+8t3NpQgxlJja/9yfSwrwOj5aihdMWj0vNaSpZdsQJkVwP0Dnyvs0he+x7VOwc ZSlJ0OYyaURlnZkE9WDkdGp6eC0ACNWgq53knHdOSpjxLvAQTuA5z8vl5RQ9mQcAWUq7 xgpBz/hFLFAbs2RouPulR1FmstMrxAJALqI75n1P39YXkVb/uahxKg0rAlkDHcBiSVql FSxw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@nbd.name header.s=20160729 header.b=K2aS83x1; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id m8si2138367edj.357.2020.11.11.10.34.23; Wed, 11 Nov 2020 10:34:59 -0800 (PST) Received-SPF: pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=fail header.i=@nbd.name header.s=20160729 header.b=K2aS83x1; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727430AbgKKSeE (ORCPT + 99 others); Wed, 11 Nov 2020 13:34:04 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44206 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726235AbgKKSeD (ORCPT ); Wed, 11 Nov 2020 13:34:03 -0500 Received: from nbd.name (nbd.name [IPv6:2a01:4f8:221:3d45::2]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 73D77C0613D1 for ; Wed, 11 Nov 2020 10:34:03 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=nbd.name; s=20160729; h=Content-Transfer-Encoding:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Sender:Reply-To:Content-Type: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=mUQJj/5A6aqLOlEFlwB9HFVaFwNXf6zvmBqCM09Y7ww=; b=K2aS83x1+C9oO+MXikl70fw+Jr LzhUBluUBYka1d+1ceHP7Q/HSrE1fEohcKigiNwpU9EJWh/kbaeH2AgM7LzOgfMEn5krw/zRz1/Rt svxOdnNlNlkR6uxDh5e//X/MGdSWvWCz2wU3OGgeRFgHXsz6fQbvAKWth3zkDmEVn1LQ=; Received: from p5b206c33.dip0.t-ipconnect.de ([91.32.108.51] helo=localhost.localdomain) by ds12 with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_CBC_SHA1:128) (Exim 4.89) (envelope-from ) id 1kcuwT-00034H-7F; Wed, 11 Nov 2020 19:34:01 +0100 From: Felix Fietkau To: linux-wireless@vger.kernel.org Cc: johannes@sipsolutions.net Subject: [PATCH 5.10 3/3] mac80211: minstrel: fix tx status processing corner case Date: Wed, 11 Nov 2020 19:33:59 +0100 Message-Id: <20201111183359.43528-3-nbd@nbd.name> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20201111183359.43528-1-nbd@nbd.name> References: <20201111183359.43528-1-nbd@nbd.name> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org Some drivers fill the status rate list without setting the rate index after the final rate to -1. minstrel_ht already deals with this, but minstrel doesn't, which causes it to get stuck at the lowest rate on these drivers. Fix this by checking the count as well. Cc: stable@vger.kernel.org Fixes: cccf129f820e ("mac80211: add the 'minstrel' rate control algorithm") Signed-off-by: Felix Fietkau --- net/mac80211/rc80211_minstrel.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net/mac80211/rc80211_minstrel.c b/net/mac80211/rc80211_minstrel.c index a8a940e97a9a..b13b1da19386 100644 --- a/net/mac80211/rc80211_minstrel.c +++ b/net/mac80211/rc80211_minstrel.c @@ -274,7 +274,7 @@ minstrel_tx_status(void *priv, struct ieee80211_supported_band *sband, success = !!(info->flags & IEEE80211_TX_STAT_ACK); for (i = 0; i < IEEE80211_TX_MAX_RATES; i++) { - if (ar[i].idx < 0) + if (ar[i].idx < 0 || !ar[i].count) break; ndx = rix_to_ndx(mi, ar[i].idx); -- 2.28.0