Re: [PATCH net v2 2/6] net: bcmasp: unmap previous DMA mappings on TX map failure
From: Justin Chen
Date: Fri Oct 09 2026 - 14:57:51 EST
On 10/8/26 2:06 PM, Florian Fainelli wrote:
When mapping an skb with fragments for transmission in bcmasp_xmit(),Reviewed-by: Justin Chen <justin.chen@xxxxxxxxxxxx>
if mapping fails on fragment i > 0, the error handler calls
bcmasp_clean_txcb() for previous iterations j < i. However,
bcmasp_clean_txcb() only zeroes the control block fields without
unmapping the DMA buffers, leaking the DMA mappings allocated for the
head and earlier fragments.
Call dma_unmap_single() before calling bcmasp_clean_txcb() in the error
cleanup loop.
Fixes: 490cb412007d ("net: bcmasp: Add support for ASP2.0 Ethernet controller")
Assisted-by: LLM
Reviewed-by: Nicolai Buchwitz <nb@xxxxxxxxxxx>
Signed-off-by: Florian Fainelli <florian.fainelli@xxxxxxxxxxxx>