From: Ajit Khaparde Date: Tue, 24 Oct 2017 21:19:48 +0000 (-0500) Subject: net/bnxt: fix a potential null pointer dereference X-Git-Tag: spdx-start~1100 X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=90cdc91c12563019340c10f32dc0b35b39e5821f;p=dpdk.git net/bnxt: fix a potential null pointer dereference Coverity issue: 195017 Fixes: 5ef3b79fdfe6 ("net/bnxt: support flow filter ops") Signed-off-by: Ajit Khaparde --- diff --git a/drivers/net/bnxt/bnxt_filter.c b/drivers/net/bnxt/bnxt_filter.c index af9ed9a623..65d30fb38f 100644 --- a/drivers/net/bnxt/bnxt_filter.c +++ b/drivers/net/bnxt/bnxt_filter.c @@ -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;