Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp2513565pxk; Sun, 27 Sep 2020 10:24:59 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwuttOTH3TiH1/9njq3tI3OimA+gJFlKbema4ifZzMov9Cwu8QaFoyLYsZZD/EwkRMkBl3/ X-Received: by 2002:a17:906:fb15:: with SMTP id lz21mr11910370ejb.185.1601227498939; Sun, 27 Sep 2020 10:24:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1601227498; cv=none; d=google.com; s=arc-20160816; b=KtTISoSYNmS7F8wHOsyhQk0UF+CCJWkTVnhq6PzOEcHfInuWrxd90okimF14g5z7+O RlArBjcia78UFnFIyQYTsrSR619GMpkt3KgQ2sl/l32HgcgDJ+RRTeqEovWI4SGLRaxn McqcUAusxEvLJrYTu5qW1YUsr4x68+l0nNqnGMgcB0HzVhKnJcnWErVKKDBeMLn8bjX6 7Gh0VbeYAXJolmi3iCEcK+ROqlNEaUq6W1GYDvhDYOxNBQFGFOzJhwERzV0+5uHbWIxu 3nFBPByjvJoyeMVGdYuM6QvasN3ILoc6w1b67IbFuCro4HCfdPOqQItH/SYZ7PadYEpH /cdA== 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:to:from :dkim-signature; bh=5RkjGxEbzXed/Ysc1Vlf14V1EgWEzf2/LcCjPFLCLh0=; b=Zgk/iIgwF516TS/SljAMCy9OxA86k5klBL7NhbbaX5Ne5VwrBxQsAwiFNsjyXvu60L pl6fZa8kBfS3rLrPrjSKJhVLPnWbI0qvKZd0FlCjZrauV4ncyht5s4wRiaws2CnBrLEk jysRikWSvfKPjXY2pfrr0dc3nEHPitsngwPFTNRLb/uBqSrj8rYa6ptuqeoU72XCLDvM OG28tOyJ+aAiPLHBtb6YVxO8CWKVy0NuLoop0tp7xtedhIuI1blLpKHH7iGHzAYlMte0 C+jZHf8Vjq0ZtTyqQFXSEdYrZM1ZJQLBUT1G0i69KMQ5HNO6PJRqTc3HgrcPjR5BjxLb mCqQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@nbd.name header.s=20160729 header.b=nMMVPXxn; 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 lc19si5949264ejb.192.2020.09.27.10.24.35; Sun, 27 Sep 2020 10:24:58 -0700 (PDT) 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=nMMVPXxn; 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 S1726382AbgI0RS7 (ORCPT + 99 others); Sun, 27 Sep 2020 13:18:59 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42338 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726325AbgI0RS4 (ORCPT ); Sun, 27 Sep 2020 13:18:56 -0400 Received: from nbd.name (nbd.name [IPv6:2a01:4f8:221:3d45::2]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E6B29C0613CE for ; Sun, 27 Sep 2020 10:18:55 -0700 (PDT) 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:To:From:Sender:Reply-To:Cc: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=5RkjGxEbzXed/Ysc1Vlf14V1EgWEzf2/LcCjPFLCLh0=; b=nMMVPXxnrZmSNZLLTXSv6GWSvz dFTGjNpGmqekFH+CE7tO77c5nM2gUJ7y/QN1hlcFUQii5LTz/je9AGDdXuTOYGs+JDzNjzOObVShy zb7OSRo244ZYnmg3SJYLyimzrA1ZWSmanJaUuJ7Jhdml2j0YOytRqiMm+JEpB6muwg9U=; Received: from p4ff134da.dip0.t-ipconnect.de ([79.241.52.218] helo=localhost.localdomain) by ds12 with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_CBC_SHA1:128) (Exim 4.89) (envelope-from ) id 1kMaK6-0002oU-Ij for linux-wireless@vger.kernel.org; Sun, 27 Sep 2020 19:18:54 +0200 From: Felix Fietkau To: linux-wireless@vger.kernel.org Subject: [PATCH 7/8] mt76: mt7915: fix processing txfree events Date: Sun, 27 Sep 2020 19:18:51 +0200 Message-Id: <20200927171852.48669-7-nbd@nbd.name> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20200927171852.48669-1-nbd@nbd.name> References: <20200927171852.48669-1-nbd@nbd.name> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org In the MT7915 info, the fields for the WLAN index / queue overlap with the token id, and the MT_TX_FREE_PAIR bit indicates, which one is present. If MT_TX_FREE_PAIR is set, skip processing the token index, since the data will not be valid. This fixes accidentally freeing tokens which are still in use by the hardware with a wrong station pointer. Signed-off-by: Felix Fietkau --- drivers/net/wireless/mediatek/mt76/mt7915/mac.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/net/wireless/mediatek/mt76/mt7915/mac.c b/drivers/net/wireless/mediatek/mt76/mt7915/mac.c index 44a5b4f8e43c..3456d9532f29 100644 --- a/drivers/net/wireless/mediatek/mt76/mt7915/mac.c +++ b/drivers/net/wireless/mediatek/mt76/mt7915/mac.c @@ -972,6 +972,7 @@ void mt7915_mac_tx_free(struct mt7915_dev *dev, struct sk_buff *skb) if (list_empty(&msta->poll_list)) list_add_tail(&msta->poll_list, &dev->sta_poll_list); spin_unlock_bh(&dev->sta_poll_lock); + continue; } msdu = FIELD_GET(MT_TX_FREE_MSDU_ID, info); -- 2.28.0