[dpdk-dev,v2,08/15] net/bnxt: fix a null pointer dereference

Message ID 20171024211953.12021-9-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
  Fix a potential null pointer reported by Coverity.
Coverity issue: 195001

Fixes: 5ef3b79fdfe6 ("net/bnxt: support flow filter ops")

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

Patch

diff --git a/drivers/net/bnxt/bnxt_ethdev.c b/drivers/net/bnxt/bnxt_ethdev.c
index 15ef0b2a2..9065a12df 100644
--- a/drivers/net/bnxt/bnxt_ethdev.c
+++ b/drivers/net/bnxt/bnxt_ethdev.c
@@ -1728,10 +1728,12 @@  bnxt_match_and_validate_ether_filter(struct bnxt *bp,
 		RTE_LOG(ERR, PMD, "unsupported ether_type(0x%04x) in"
 			" ethertype filter.", efilter->ether_type);
 		*ret = -EINVAL;
+		goto exit;
 	}
 	if (efilter->queue >= bp->rx_nr_rings) {
 		RTE_LOG(ERR, PMD, "Invalid queue %d\n", efilter->queue);
 		*ret = -EINVAL;
+		goto exit;
 	}
 
 	vnic0 = STAILQ_FIRST(&bp->ff_pool[0]);
@@ -1739,6 +1741,7 @@  bnxt_match_and_validate_ether_filter(struct bnxt *bp,
 	if (vnic == NULL) {
 		RTE_LOG(ERR, PMD, "Invalid queue %d\n", efilter->queue);
 		*ret = -EINVAL;
+		goto exit;
 	}
 
 	if (efilter->flags & RTE_ETHTYPE_FLAGS_DROP) {
@@ -1767,6 +1770,7 @@  bnxt_match_and_validate_ether_filter(struct bnxt *bp,
 	if (match)
 		*ret = -EEXIST;
 
+exit:
 	return mfilter;
 }