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 DC6FE27466A; Mon, 13 Apr 2026 16:12:28 +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=1776096748; cv=none; b=h1Fn6JV84LRMa1Yi3imGM5jrCqBZWZDbx5z2ji5XxS7LNj/z/ov1TIaK9qsb7LSZZtgf0QfPNeOERhZruDyrQJY/CRxbdhcZPNtqHQJXz09b+NRhTuNeVYwvYYN010dnVYtkI95iq+jVxry0fhc4+5KV4orOFSkEA9+75JMB+vw= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1776096748; c=relaxed/simple; bh=Hx5vWiUXALgzAO3mnPYy41ph4Zy9F2dJrfQ1uvKXJVw=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=I/FvgeX0yaAXBkKJ1A3r0pebtnZdlBZRQBD7xujqnwW80YPTsws4AaP/1WutiHes2OUG5nf2D/ZcA7gTUVnwN5F9td9e39luNlZE1eGCQ/VnGJToWczGtisk3QDwOAYRoGQXFoNUH98gLRDZeA/YsGNpuSnFjF/42U8ZtjW2c+Y= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=qrpRK2+S; 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="qrpRK2+S" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 73ECDC2BCB4; Mon, 13 Apr 2026 16:12:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1776096748; bh=Hx5vWiUXALgzAO3mnPYy41ph4Zy9F2dJrfQ1uvKXJVw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=qrpRK2+S6E1Lvh7lpg7256WACVxzwfkfU9oPiCiwdCkPvkA33jTwdWT/e3qZpzeTe c9lZZw98Ic6IzSyXHSV775cX9lliFJaYNXNR/b9lC+AilQcrHMdzfSyp42H/VHIV4h zcoZkN3//3/cCLtn43KRGoQXBSGkErJmoWG6IsQc= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, David Carlier , Jakub Kicinski Subject: [PATCH 6.12 46/70] net: altera-tse: fix skb leak on DMA mapping error in tse_start_xmit() Date: Mon, 13 Apr 2026 18:00:41 +0200 Message-ID: <20260413155729.904145155@linuxfoundation.org> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260413155728.181580293@linuxfoundation.org> References: <20260413155728.181580293@linuxfoundation.org> User-Agent: quilt/0.69 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: stable@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 6.12-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 @@ -572,6 +572,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; }