net/bnxt: fix a potential null pointer dereference
authorAjit Khaparde <ajit.khaparde@broadcom.com>
Tue, 24 Oct 2017 21:19:48 +0000 (16:19 -0500)
committerFerruh Yigit <ferruh.yigit@intel.com>
Thu, 26 Oct 2017 00:33:01 +0000 (02:33 +0200)
Coverity issue: 195017
Fixes: 5ef3b79fdfe6 ("net/bnxt: support flow filter ops")

Signed-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
drivers/net/bnxt/bnxt_filter.c

index af9ed9a..65d30fb 100644 (file)
@@ -793,6 +793,8 @@ bnxt_get_l2_filter(struct bnxt *bp, struct bnxt_filter_info *nf,
        //This flow needs DST MAC which is not same as port/l2
        RTE_LOG(DEBUG, PMD, "Create L2 filter for DST MAC\n");
        filter1 = bnxt_get_unused_filter(bp);
+       if (filter1 == NULL)
+               return NULL;
        filter1->flags = HWRM_CFA_L2_FILTER_ALLOC_INPUT_FLAGS_PATH_RX;
        filter1->enables = HWRM_CFA_L2_FILTER_ALLOC_INPUT_ENABLES_L2_ADDR |
                        L2_FILTER_ALLOC_INPUT_EN_L2_ADDR_MASK;