Re: [PATCH v2 08/17] net/dpaa2: fix error packet dump crash and memory leak

Stephen Hemminger
2026-02-26T19:23:09Z

On Thu, 26 Feb 2026 15:33:32 +0100
Maxime Leroy <maxime@leroys.fr> wrote:

> Fix three bugs in dump_err_pkts():
>
> 1. NULL pointer dereference: mbuf was checked for NULL but then
> dereferenced unconditionally on the next line.
>
> 2. Memory leak on multi-segment packets: the while loop walked
> mbuf to NULL, so the subsequent rte_pktmbuf_free(mbuf) was a
> no-op and the packet was never freed. Use a separate iterator
> variable and free the original mbuf pointer.
>
> 3. Segment index not reset between packets: variable i was
> initialized once at function scope and never reset inside the
> do/while loop, so hexdump titles had wrong segment numbers.
> Make it local to the multi-segment block.
>
> Not tested, found by code review.
>
> Fixes: 8b49427e73 ("net/dpaa2: add Rx error queue support")
> Cc: stable@dpdk.org

You need to use longer (12 character) SHAs on Fixes tags now.
Same problem in patch 14