summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAjit Khaparde <ajit.khaparde@broadcom.com>2017-07-20 22:22:32 -0500
committerYuanhan Liu <yliu@fridaylinux.org>2017-08-29 14:55:37 +0800
commit802dc1443e056b69708c46f82a6b9ba5a7d4a22e (patch)
tree4a3966d123bc7997b7490d84afc6e120f619a5f0
parent4af5fea1c4c1a9395097468381764a7ec77d3498 (diff)
downloaddpdk-stable-802dc1443e056b69708c46f82a6b9ba5a7d4a22e.zip
dpdk-stable-802dc1443e056b69708c46f82a6b9ba5a7d4a22e.tar.gz
dpdk-stable-802dc1443e056b69708c46f82a6b9ba5a7d4a22e.tar.xz
net/bnxt: check invalid L2 filter id
[ upstream commit 778f6209bc3b39339f2969a57ffb46f2cd396f15 ] Add code to check for invalid filter_id in bnxt_hwrm_clear_filter Fixes: f92735db1e4c ("net/bnxt: add L2 filter alloc/init/free") Signed-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
-rw-r--r--drivers/net/bnxt/bnxt_hwrm.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/net/bnxt/bnxt_hwrm.c b/drivers/net/bnxt/bnxt_hwrm.c
index eec29b3..6a5159c 100644
--- a/drivers/net/bnxt/bnxt_hwrm.c
+++ b/drivers/net/bnxt/bnxt_hwrm.c
@@ -196,6 +196,9 @@ int bnxt_hwrm_clear_filter(struct bnxt *bp,
struct hwrm_cfa_l2_filter_free_input req = {.req_type = 0 };
struct hwrm_cfa_l2_filter_free_output *resp = bp->hwrm_cmd_resp_addr;
+ if (filter->fw_l2_filter_id == UINT64_MAX)
+ return 0;
+
HWRM_PREP(req, CFA_L2_FILTER_FREE, -1, resp);
req.l2_filter_id = rte_cpu_to_le_64(filter->fw_l2_filter_id);