[dpdk-dev,v2,09/15] net/bnxt: fix an issue reported by Coverity

Message ID 20171024211953.12021-10-ajit.khaparde@broadcom.com (mailing list archive)
State Accepted, archived
Delegated to: Ferruh Yigit
Headers

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/Intel-compilation success Compilation OK

Commit Message

Ajit Khaparde Oct. 24, 2017, 9:19 p.m. UTC
  Fixes: b7435d660a8c ("net/bnxt: add ntuple filtering support")
Coverity issue: 195015

Signed-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
---
 drivers/net/bnxt/bnxt_ethdev.c | 5 +++++
 1 file changed, 5 insertions(+)
  

Patch

diff --git a/drivers/net/bnxt/bnxt_ethdev.c b/drivers/net/bnxt/bnxt_ethdev.c
index 9065a12df..c2d54efd8 100644
--- a/drivers/net/bnxt/bnxt_ethdev.c
+++ b/drivers/net/bnxt/bnxt_ethdev.c
@@ -2039,6 +2039,11 @@  bnxt_cfg_ntuple_filter(struct bnxt *bp,
 			goto free_filter;
 		STAILQ_INSERT_TAIL(&vnic->filter, bfilter, next);
 	} else {
+		if (mfilter == NULL) {
+			/* This should not happen. But for Coverity! */
+			ret = -ENOENT;
+			goto free_filter;
+		}
 		ret = bnxt_hwrm_clear_ntuple_filter(bp, mfilter);
 
 		STAILQ_REMOVE(&vnic->filter, mfilter, bnxt_filter_info,