[PATCH] net/bnxt: fix free of not allocated object

Stephen Hemminger stephen at networkplumber.org
Sat Aug 2 18:03:03 CEST 2025


On Wed, 21 May 2025 12:37:27 -0700
Stephen Hemminger <stephen at networkplumber.org> wrote:

> This was found as error when compiling with LTO.
> The function allocates new data with rte_zmalloc and then
> stores pointer in the pointer-to-pointer passed as argument.
> In the unwind case, it would call rte_free() with wrong one.
> 
> Fixes: 80317ff6adfd ("net/bnxt/tf_core: support Thor2")
> 
> Signed-off-by: Stephen Hemminger <stephen at networkplumber.org>
> ---

Ping. This fixes a real bug why is it being ignored?

In function ‘tfo_open’,                                                         
    inlined from ‘tfc_open’ at ../drivers/net/bnxt/tf_core/v3/tfc_init.c:34:2,
    inlined from ‘ulp_tfc_ctx_attach’ at ../drivers/net/bnxt/tf_ulp/bnxt_ulp_tfc.c:783:7:
../drivers/net/bnxt/tf_core/v3/tfo.c:108:17: warning: ‘rte_free’ called on pointer ‘bp_44(D)’ with nonzero offset 800 [-Wfree-nonheap-object]
  108 |                 rte_free(tfo);
      |                 ^
In function ‘tfo_open’,
    inlined from ‘tfc_open’ at ../drivers/net/bnxt/tf_core/v3/tfc_init.c:34:2,
    inlined from ‘ulp_tfc_init’ at ../drivers/net/bnxt/tf_ulp/bnxt_ulp_tfc.c:957:7:
../drivers/net/bnxt/tf_core/v3/tfo.c:108:17: warning: ‘rte_free’ called on pointer ‘bp_74(D)’ with nonzero offset 800 [-Wfree-nonheap-object]
  108 |                 rte_free(tfo);
      |                 ^


More information about the dev mailing list