Skip to content

Commit

Permalink
common/cnxk: fix null pointer dereference
Browse files Browse the repository at this point in the history
[ upstream commit ea0d681 ]

Fix null pointer dereference reported in coverity scan.

Coverity issue: 372065
Fixes: 665b6a7 ("common/cnxk: add NPC helper API")

Signed-off-by: Gowrishankar Muthukrishnan <gmuthukrishn@marvell.com>
Acked-by: Jerin Jacob <jerinj@marvell.com>
  • Loading branch information
Gowrishankar Muthukrishnan authored and kevintraynor committed May 24, 2022
1 parent d137867 commit a10e2ec
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions drivers/common/cnxk/roc_npc_utils.c
Expand Up @@ -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
*/
Expand Down

0 comments on commit a10e2ec

Please sign in to comment.