Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp4624172pxj; Wed, 12 May 2021 09:28:44 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxWVSnVFxovQHEO/CeMjCrh3UM7f8jTicrlaLodm40S6JxUR5UhlhQJzE4TNXfro3uNogox X-Received: by 2002:a05:6402:1a58:: with SMTP id bf24mr4813159edb.146.1620836924132; Wed, 12 May 2021 09:28:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1620836924; cv=none; d=google.com; s=arc-20160816; b=SiTwncyAYUeHEwxF/52zbbSWhLrbdsBoUJo+xVvU8FF4BX9J22sZi35MKPN5t17Wa8 lwQeuBGoenL3o/TqXp66B9JBWZsXXE3CzTyqqkgs1yiVOekKqRgh1NKnA42iS+LkJush K5JxHA1g9WiPw6WVRux6uq+54CTCdpnR8vyPjZ2P1BlDxYM69JH9Gp0FDuskl/tjMO6h c4zihLxLAdAuZzsYm5zuXKvWsRoMe+zAdeZ5U2vXLubOo10eRioMoc8FmifwUOJEK9UN GoyXDk4AK2/M2YK7YPpvfAq9fDu/gHL3ZwaSwszWhVsJqK/XeYKt4+zN1tOP4xJSWg8N kQdA== 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 :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=TpswgNG8ku3lYS9sGipGJChJi/PDtJwOD1tNswqNFCA=; b=Z/7jeQ7Iwg43lk9c847HpJrIAvRTNxWvlE2Y6iS5vrDavGbKNh60QJ8mRtipqxTgGj 7CpErQAdCBZiAwiYbIGpOzwos7fjAsKIQTSleSfZbIEiyilExvrdrS94f6WvdSr3vTbE IVza5nl4qRvJTZbxI1IgSSYWIl/TA9QWzFId88P/fmCdcBCP6TzExhdGaQ/+eiQklg9h ivJCOGw2FmYrCkhxOLbWvFxYE7QbXRB5fjloDO6uXH2GNvRUmKmszpMnlPcTLsjVcbyN qpQauhKQzniWn5GXv9BmIE6kI3qnWih6yDV1MzCAFatrzk3olbmdv8KqJ5FSvNleuPQ6 54/A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=WbfeSP4Q; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id c14si215399edr.0.2021.05.12.09.28.19; Wed, 12 May 2021 09:28:44 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=WbfeSP4Q; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S241170AbhELQ0r (ORCPT + 99 others); Wed, 12 May 2021 12:26:47 -0400 Received: from mail.kernel.org ([198.145.29.99]:54422 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236362AbhELPhs (ORCPT ); Wed, 12 May 2021 11:37:48 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id F018E61492; Wed, 12 May 2021 15:19:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1620832761; bh=ToiDdiDBDkoLSvyW7lUKVeyTxFCHYMNWxtJ4Bru9NhI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=WbfeSP4QqxxOyGv28SjZDeJvYRFA3W9eLlQ0wFmn8192DSmIUFd65LcKO17He9BYS A+gDP9d+31HpsZ4FgjesEnKK6Po+QmGWZ7wHbZT1tALn7t0D4PQyQ3rueyxIxaPTAI Maoc/S8m+NaMpRKzGCwh8J5jDB3fcwGysH/nDnO8= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Ben Greear , Felix Fietkau , Sasha Levin Subject: [PATCH 5.10 413/530] mt76: mt7915: fix tx skb dma unmap Date: Wed, 12 May 2021 16:48:43 +0200 Message-Id: <20210512144833.335935301@linuxfoundation.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210512144819.664462530@linuxfoundation.org> References: <20210512144819.664462530@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Felix Fietkau [ Upstream commit 7dcf3c04f0aca746517a77433b33d40868ca4749 ] 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 Signed-off-by: Sasha Levin --- 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 6f159d99a596..dd5793004989 100644 --- a/drivers/net/wireless/mediatek/mt76/mt7915/mac.c +++ b/drivers/net/wireless/mediatek/mt76/mt7915/mac.c @@ -856,7 +856,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.30.2