On Sun, Apr 24, 2022 at 9:47 PM Gowrishankar Muthukrishnan <[email protected]> wrote: > > Fix null pointer dereference reported in coverity scan. > > Coverity issue: 372065
Cc: [email protected] > Fixes: 665b6a7400b ("common/cnxk: add NPC helper API") > > Signed-off-by: Gowrishankar Muthukrishnan <[email protected]> Acked-by: Jerin Jacob <[email protected]> Applied to dpdk-next-net-mrvl/for-next-net. Thanks > --- > drivers/common/cnxk/roc_npc_utils.c | 3 +++ > 1 file changed, 3 insertions(+) > > diff --git a/drivers/common/cnxk/roc_npc_utils.c > b/drivers/common/cnxk/roc_npc_utils.c > index f9768ea3cf..dadd8826cb 100644 > --- a/drivers/common/cnxk/roc_npc_utils.c > +++ b/drivers/common/cnxk/roc_npc_utils.c > @@ -145,6 +145,9 @@ npc_parse_item_basic(const struct roc_npc_item_info *item, > info->mask = item->mask; > } > > + if (info->mask == NULL) > + return NPC_ERR_INVALID_MASK; > + > /* mask specified must be subset of hw supported mask > * mask | hw_mask == hw_mask > */ > -- > 2.25.1 >

