From: Ajit Khaparde Date: Fri, 21 Jul 2017 03:22:32 +0000 (-0500) Subject: net/bnxt: check invalid L2 filter id X-Git-Tag: spdx-start~2311 X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=778f6209bc3b39339f2969a57ffb46f2cd396f15;p=dpdk.git net/bnxt: check invalid L2 filter id Add code to check for invalid filter_id in bnxt_hwrm_clear_filter Fixes: f92735db1e4c ("net/bnxt: add L2 filter alloc/init/free") Cc: stable@dpdk.org Signed-off-by: Ajit Khaparde --- diff --git a/drivers/net/bnxt/bnxt_hwrm.c b/drivers/net/bnxt/bnxt_hwrm.c index a82cc819f7..e230b468ee 100644 --- a/drivers/net/bnxt/bnxt_hwrm.c +++ b/drivers/net/bnxt/bnxt_hwrm.c @@ -327,6 +327,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);