[PATCH v4 2/3] net/xsc: fix leak and missing null check

Thomas Monjalon thomas at monjalon.net
Sun Nov 22 10:23:26 CET 2026


21/11/2026 09:04, Renyong Wan:
> On 11/20/2026 6:36 PM, Thomas Monjalon wrote:
> > 17/11/2026 12:14, Renyong Wan:
> >> xsc_dev_init() leaks the structure when the dev_ops lookup fails. Free
> >> it there: xsc_dev_uninit() cannot be used, as xsc_dev_close()
> >> dereferences xdev->dev_ops.
> >>
> >> xsc_ethdev_tx_queue_setup() misses the NULL check on the
> >> rte_malloc_socket() result. Return -ENOMEM, as the Rx path does.
> > 
> > I don't see how fixes are related.
> > It's probably better to have 2 commits.
> 
> Hi Thomas,
> 
> You are right, they are two different bugs in two different functions.
> They ended up in one commit because the GCC analyzer reported them under
> a single entry, written in the original report as:
> 
>   46: xsc_dev_init() leaks a structure on the dev_ops failure path,
>     and the Tx queue allocation is dereferenced without a NULL check.
> 
> So I fixed both where they were reported. They are independent though,
> and each one carries its own Fixes tag.
> 
> If you prefer two commits, I will send a v5 with four patches, the code
> would be identical. Please let me know.

Yes please, better to split.





More information about the dev mailing list