From: Prashant Gupta <[email protected]>
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: [email protected]
Signed-off-by: Prashant Gupta <[email protected]>
---
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