From: Ajit Khaparde Date: Tue, 24 Oct 2017 21:19:47 +0000 (-0500) Subject: net/bnxt: fix a pointer deref before null check X-Git-Tag: spdx-start~1101 X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=e6bea83ee3ba49123eb26f6442b9cd27b4ec6215;p=dpdk.git net/bnxt: fix a pointer deref before null check Coverity issue: 195015 Fixes: b7435d660a8c ("net/bnxt: add ntuple filtering support") Signed-off-by: Ajit Khaparde --- diff --git a/drivers/net/bnxt/bnxt_ethdev.c b/drivers/net/bnxt/bnxt_ethdev.c index 9065a12dfc..c2d54efd89 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,