Re: [PATCH net] net: hip04: fix RX buffer leak on build_skb failure

From: Jacob Keller

Date: Wed Jul 15 2026 - 12:53:04 EST


On 7/12/2026 7:27 AM, Fan Wu wrote:
> When build_skb() fails in hip04_rx_poll(), the driver jumps to the
> refill path without releasing the current RX buffer and its DMA mapping.
> Installing a replacement buffer then overwrites the slot references and
> leaks both resources.
>
> Keep the current slot intact and return budget so NAPI retries the same
> buffer. Also free a newly allocated RX fragment when dma_map_single()
> fails.
>
> This issue was found by an in-house static analysis tool.
>
> Fixes: 701a0fd52318 ("hip04_eth: fix missing error handle for build_skb failed")
> Cc: stable@xxxxxxxxxxxxxxx
> Assisted-by: Codex:gpt-5.5
> Signed-off-by: Fan Wu <fanwu01@xxxxxxxxxx>
> ---
>

Reviewed-by: Jacob Keller <jacob.e.keller@xxxxxxxxx>