[PATCH v1 05/17] net/dpaa/fmlib: add null check in scheme delete

Hemant Agrawal hemant.agrawal at nxp.com
Thu Jun 18 16:11:39 CEST 2026


From: Prashant Gupta <prashant.gupta_3 at nxp.com>

Add a null pointer check before dereferencing the scheme handle
in FM_PCD_MatchTableSchemeDelete() to prevent potential null
pointer dereference.

Fixes: 663ff698e3 ("net/dpaa: support VSP in fmlib")
Cc: stable at dpdk.org

Signed-off-by: Prashant Gupta <prashant.gupta_3 at nxp.com>
---
 drivers/net/dpaa/fmlib/fm_lib.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/net/dpaa/fmlib/fm_lib.c b/drivers/net/dpaa/fmlib/fm_lib.c
index b35feba004..65a818372e 100644
--- a/drivers/net/dpaa/fmlib/fm_lib.c
+++ b/drivers/net/dpaa/fmlib/fm_lib.c
@@ -305,6 +305,9 @@ fm_pcd_kg_scheme_delete(t_handle h_scheme)
 
 	_fml_dbg("Calling...");
 
+	if (p_dev == NULL)
+		return E_NO_DEVICE;
+
 	p_pcd_dev =  (t_device *)p_dev->h_user_priv;
 	id.obj = UINT_TO_PTR(p_dev->id);
 
-- 
2.43.0



More information about the dev mailing list