DPDK-dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v1 0/1] net/nbl: fix Leonis resource ops cleanup
@ 2026-12-02  3:08 Dimon Zhao
  2026-12-02  3:08 ` [PATCH v1 1/1] " Dimon Zhao
  0 siblings, 1 reply; 3+ messages in thread
From: Dimon Zhao @ 2026-12-02  3:08 UTC (permalink / raw)
  To: dev; +Cc: Dimon Zhao

This patch fixes the Leonis resource ops setup error path. It releases
the calloc()-allocated table with free() and clears the pointer.

Dimon Zhao (1):
  net/nbl: fix Leonis resource ops cleanup

 drivers/net/nbl/nbl_hw/nbl_hw_leonis/nbl_res_leonis.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

-- 
2.53.0


^ permalink raw reply	[flat|nested] 3+ messages in thread

* [PATCH v1 1/1] net/nbl: fix Leonis resource ops cleanup
  2026-12-02  3:08 [PATCH v1 0/1] net/nbl: fix Leonis resource ops cleanup Dimon Zhao
@ 2026-12-02  3:08 ` Dimon Zhao
  2026-12-03 20:25   ` Stephen Hemminger
  0 siblings, 1 reply; 3+ messages in thread
From: Dimon Zhao @ 2026-12-02  3:08 UTC (permalink / raw)
  To: dev; +Cc: Dimon Zhao, stable, Leon Yu, Sam Chen

The Leonis resource ops table is allocated with calloc(). If Tx/Rx ops
setup fails, the error path releases the table with rte_free().

Free the table with free() and clear the pointer on setup failure.

Fixes: c2d6a1b7a491 ("net/nbl: add resource layer")
Cc: stable@dpdk.org
Signed-off-by: Dimon Zhao <dimon.zhao@nebula-matrix.com>
---
 drivers/net/nbl/nbl_hw/nbl_hw_leonis/nbl_res_leonis.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/net/nbl/nbl_hw/nbl_hw_leonis/nbl_res_leonis.c b/drivers/net/nbl/nbl_hw/nbl_hw_leonis/nbl_res_leonis.c
index 5d40d4f..6f06943 100644
--- a/drivers/net/nbl/nbl_hw/nbl_hw_leonis/nbl_res_leonis.c
+++ b/drivers/net/nbl/nbl_hw/nbl_hw_leonis/nbl_res_leonis.c
@@ -151,7 +151,8 @@ static int nbl_res_setup_ops(struct nbl_resource_ops_tbl **res_ops_tbl,
 	return ret;
 
 set_ops_failed:
-	rte_free(*res_ops_tbl);
+	free(*res_ops_tbl);
+	*res_ops_tbl = NULL;
 	return ret;
 }
 
-- 
2.53.0


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH v1 1/1] net/nbl: fix Leonis resource ops cleanup
  2026-12-02  3:08 ` [PATCH v1 1/1] " Dimon Zhao
@ 2026-12-03 20:25   ` Stephen Hemminger
  0 siblings, 0 replies; 3+ messages in thread
From: Stephen Hemminger @ 2026-12-03 20:25 UTC (permalink / raw)
  To: Dimon Zhao; +Cc: dev, stable, Leon Yu, Sam Chen

On Wed,  2 Dec 2026 11:08:50 +0800
Dimon Zhao <dimon.zhao@nebula-matrix.com> wrote:

> The Leonis resource ops table is allocated with calloc(). If Tx/Rx ops
> setup fails, the error path releases the table with rte_free().
> 
> Free the table with free() and clear the pointer on setup failure.
> 
> Fixes: c2d6a1b7a491 ("net/nbl: add resource layer")
> Cc: stable@dpdk.org
> Signed-off-by: Dimon Zhao <dimon.zhao@nebula-matrix.com>
> ---
 

Applied to next-net

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2026-12-03 20:25 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-12-02  3:08 [PATCH v1 0/1] net/nbl: fix Leonis resource ops cleanup Dimon Zhao
2026-12-02  3:08 ` [PATCH v1 1/1] " Dimon Zhao
2026-12-03 20:25   ` Stephen Hemminger

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox