net/bnxt: fix a pointer deref before null check

Coverity issue: 195015
Fixes: b7435d660a ("net/bnxt: add ntuple filtering support")

Signed-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
This commit is contained in:
Ajit Khaparde 2017-10-24 16:19:47 -05:00 committed by Ferruh Yigit
parent 1498060ffb
commit e6bea83ee3

View File

@ -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,