[dpdk-dev] [PATCH 09/18] net/bnxt: add null check for mark table
Kalesh A P
kalesh-anakkur.purayil at broadcom.com
Tue Jan 4 09:38:15 CET 2022
From: Kalesh AP <kalesh-anakkur.purayil at broadcom.com>
During the port start, driver ignores mark table allocation failure.
This could cause a segfault due to NULL pointer dereference in
bnxt_set_mark_in_mbuf(). Fix this by checking the pointer validity
before accessing it.
Fixes: b87abb2e55cb ("net/bnxt: support marking packet")
Cc: stable at dpdk.org
Signed-off-by: Kalesh AP <kalesh-anakkur.purayil at broadcom.com>
Reviewed-by: Ajit Khaparde <ajit.khaparde at broadcom.com>
Reviewed-by: Somnath Kotur <somnath.kotur at broadcom.com>
---
drivers/net/bnxt/bnxt_rxr.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/drivers/net/bnxt/bnxt_rxr.c b/drivers/net/bnxt/bnxt_rxr.c
index 44247d7..9621809 100644
--- a/drivers/net/bnxt/bnxt_rxr.c
+++ b/drivers/net/bnxt/bnxt_rxr.c
@@ -824,6 +824,9 @@ void bnxt_set_mark_in_mbuf(struct bnxt *bp,
{
uint32_t cfa_code = 0;
+ if (unlikely(bp->mark_table == NULL))
+ return;
+
cfa_code = rte_le_to_cpu_16(rxcmp1->cfa_code);
if (!cfa_code)
return;
--
2.10.1
More information about the dev
mailing list