[PATCH] common/cnxk: fix null pointer dereference

Jerin Jacob jerinjacobk at gmail.com
Thu May 5 10:34:10 CEST 2022


On Sun, Apr 24, 2022 at 9:47 PM Gowrishankar Muthukrishnan
<gmuthukrishn at marvell.com> wrote:
>
> Fix null pointer dereference reported in coverity scan.
>
> Coverity issue: 372065

Cc: stable at dpdk.org

> Fixes: 665b6a7400b ("common/cnxk: add NPC helper API")
>
> Signed-off-by: Gowrishankar Muthukrishnan <gmuthukrishn at marvell.com>

Acked-by: Jerin Jacob <jerinj at marvell.com>
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
>


More information about the dev mailing list