From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 9B48730BF4E; Mon, 13 Apr 2026 16:41:03 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1776098463; cv=none; b=sYc3+pDNiyqLgVOaDLEgfz08QmBMwvXv/p59MRSmKQ6239yTFoeDaUljfV3qSsb4NpgkIP6FoMuDNhsWHvP/sfaHs0DapxPpT0fDWYU0LTmVrUksAcPS5YBXIygKBcgxtl+EI12xJM6lL3VzxY4aU5e1gKpoSELz4vc7ZvfK+po= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1776098463; c=relaxed/simple; bh=PCzaGoBSwZmce3I20+yakCJ3d82LkGBPQ0qL+PDyypA=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=SCoqwKvavCErH6Wz/9/eky+IFb1vVcBOKt7rgWhI5athiBwAQ6bnMydlEXDqnyMyqAsccz6dUUBW1Qe+NGPDjoYIoka4sm6okDlACIiItBmMNxyBA2fe6Fl3h92GpWqcEOSydjCUg6ZhFrajR6N1aDovPmKuRI6kHADdjjclLlc= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=1CK2Fegq; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="1CK2Fegq" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 2E200C2BCAF; Mon, 13 Apr 2026 16:41:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1776098463; bh=PCzaGoBSwZmce3I20+yakCJ3d82LkGBPQ0qL+PDyypA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=1CK2Fegq6APOPui3Yb7a6Pwts9CpIsowcRosW6JjKTa/JpJcYjyTsL14ytBf8LvYg bDs5/xFkgS2SzaI6U6DTCqVuiTJk4e9rHTGQLZZlOC1bwVXib5lz7gcTEe1AYEkq63 QfG3nHQIGBu0FZPHeG4R0zji9su1J7sp2fGL+SBI= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, David Carlier , Jakub Kicinski Subject: [PATCH 5.15 534/570] net: altera-tse: fix skb leak on DMA mapping error in tse_start_xmit() Date: Mon, 13 Apr 2026 18:01:05 +0200 Message-ID: <20260413155850.448968331@linuxfoundation.org> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260413155830.386096114@linuxfoundation.org> References: <20260413155830.386096114@linuxfoundation.org> User-Agent: quilt/0.69 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: patches@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 5.15-stable review patch. If anyone has any objections, please let me know. ------------------ From: David Carlier commit 6dede3967619b5944003227a5d09fdc21ed57d10 upstream. When dma_map_single() fails in tse_start_xmit(), the function returns NETDEV_TX_OK without freeing the skb. Since NETDEV_TX_OK tells the stack the packet was consumed, the skb is never freed, leaking memory on every DMA mapping failure. Add dev_kfree_skb_any() before returning to properly free the skb. Fixes: bbd2190ce96d ("Altera TSE: Add main and header file for Altera Ethernet Driver") Cc: stable@vger.kernel.org Signed-off-by: David Carlier Link: https://patch.msgid.link/20260401211218.279185-1-devnexen@gmail.com Signed-off-by: Jakub Kicinski Signed-off-by: Greg Kroah-Hartman --- drivers/net/ethernet/altera/altera_tse_main.c | 1 + 1 file changed, 1 insertion(+) --- a/drivers/net/ethernet/altera/altera_tse_main.c +++ b/drivers/net/ethernet/altera/altera_tse_main.c @@ -591,6 +591,7 @@ static netdev_tx_t tse_start_xmit(struct DMA_TO_DEVICE); if (dma_mapping_error(priv->device, dma_addr)) { netdev_err(priv->dev, "%s: DMA mapping error\n", __func__); + dev_kfree_skb_any(skb); ret = NETDEV_TX_OK; goto out; }