Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp3810489pxb; Sat, 13 Feb 2021 09:57:40 -0800 (PST) X-Google-Smtp-Source: ABdhPJzQy+B9BvTM7o+M/QuOYyuIISxIZ9gNJ1BoZm5g7/9As5an88oTNHnJNy4oOELNn1u5Ev4Z X-Received: by 2002:a05:6402:786:: with SMTP id d6mr8655589edy.270.1613239060741; Sat, 13 Feb 2021 09:57:40 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1613239060; cv=none; d=google.com; s=arc-20160816; b=b/1ksKwMpQtoh4No8A1zwMJm5q4GRAHp5148Jhu0OGNYd0SsMJbHx5tV6Sk+9kKDUh UBltZH0WWriKc4KbVE9rlbupNWbIfLrAf6QCRY1QVknVxm4rgK0zVzTP0DJe6jiaxQYS ugfm1KpKUwjvlOPI/QZxAuA1BeEtKpeTn16HiEOY2NFgMEsSOYC0yKeKGMA6TRtQIDkC bRlgeFMJHUuRYT8gKfThUwFSkpJoiujNk9EqgsE+8pArJTca8bRbsMtVqWYjhKXdhkRS wU43s3TVzwDu69ChBm99/iVW9AHzMsLxLopOh6zF1pAXjvgc3KSMjZ6Km+0UGRhkCFs2 kmjA== 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=98aJN4IgCwZRNNHnxh9mFC2qbV2kNIxBsTGqOP8Iiq4=; b=xVYTb/YIHO3qJ8F/wEKTuhIQ1x13sWlyTG5C/V6ruEQQSTULrj8/wdNPUPyfkvficg +3kSFwzSLEWbi9KBZvzbpBuk57YfsNeQIMY15r7IsfBZICQ0TIm+Q3PKz9iFC9dP1uLk 96iJGk5Gg1YiLl7TQYxwWfjPLOhfGTLCwuyctGF58XikhdqqDYZzphdEJ1IafvomPrm4 B7pdRQolusA0Fd+l7a+H9j0tuLj/ywQjk7eg/NBM1RVButbxJ23Eb1FKkdvSNolkqbHp mGmRoRBCjnmM7D4v6iwDdKIUkA3YY3CusjjHuxYq+zThs0cvRT7eA0IbiKsdFSMb8Sj0 tp8w== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@nbd.name header.s=20160729 header.b="QrD/Pvow"; 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 o9si9730640ejr.220.2021.02.13.09.57.17; Sat, 13 Feb 2021 09:57:40 -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="QrD/Pvow"; 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 S229759AbhBMRww (ORCPT + 99 others); Sat, 13 Feb 2021 12:52:52 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49432 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229789AbhBMRwm (ORCPT ); Sat, 13 Feb 2021 12:52:42 -0500 Received: from nbd.name (nbd.name [IPv6:2a01:4f8:221:3d45::2]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E7085C06178C for ; Sat, 13 Feb 2021 09:51:05 -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: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=98aJN4IgCwZRNNHnxh9mFC2qbV2kNIxBsTGqOP8Iiq4=; b=QrD/PvowL+A5dz9ghc+mf4lt0C d6+xh39HGnSWNJDVYoateT4j67siV4IYtmOzdPuhm+i19nrVjNBTHUQvmRiFYPw+H8PlAQnswtqyJ ozAzeAzGX9tkIY47kwH+1wYfr5qg6jpREfzgEhtsvsKd9W25WxsxlhW6R+Tkq8n6gNJY=; Received: from p4ff13c8d.dip0.t-ipconnect.de ([79.241.60.141] helo=localhost.localdomain) by ds12 with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_CBC_SHA1:128) (Exim 4.89) (envelope-from ) id 1lAz4R-0007si-6p for linux-wireless@vger.kernel.org; Sat, 13 Feb 2021 18:51:03 +0100 From: Felix Fietkau To: linux-wireless@vger.kernel.org Subject: [PATCH 7/7] mt76: mt7915: fix tx skb dma unmap Date: Sat, 13 Feb 2021 18:51:00 +0100 Message-Id: <20210213175100.22608-7-nbd@nbd.name> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20210213175100.22608-1-nbd@nbd.name> References: <20210213175100.22608-1-nbd@nbd.name> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org The first pointer in the txp needs to be unmapped as well, otherwise it will leak DMA mapping entries Reported-by: Ben Greear Fixes: 27d5c528a7ca ("mt76: fix double DMA unmap of the first buffer on 7615/7915") Signed-off-by: Felix Fietkau --- drivers/net/wireless/mediatek/mt76/mt7915/mac.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/wireless/mediatek/mt76/mt7915/mac.c b/drivers/net/wireless/mediatek/mt76/mt7915/mac.c index 71ccefcdc89c..b3168dd3baed 100644 --- a/drivers/net/wireless/mediatek/mt76/mt7915/mac.c +++ b/drivers/net/wireless/mediatek/mt76/mt7915/mac.c @@ -1136,7 +1136,7 @@ void mt7915_txp_skb_unmap(struct mt76_dev *dev, int i; txp = mt7915_txwi_to_txp(dev, t); - for (i = 1; i < txp->nbuf; i++) + for (i = 0; i < txp->nbuf; i++) dma_unmap_single(dev->dev, le32_to_cpu(txp->buf[i]), le16_to_cpu(txp->len[i]), DMA_TO_DEVICE); } -- 2.28.0