DPDK patches and discussions
 help / color / mirror / Atom feed
* [PATCH] common/cnxk: fix null pointer dereference
@ 2022-04-24 16:17 Gowrishankar Muthukrishnan
  2022-05-05  8:34 ` Jerin Jacob
  0 siblings, 1 reply; 2+ messages in thread
From: Gowrishankar Muthukrishnan @ 2022-04-24 16:17 UTC (permalink / raw)
  To: dev
  Cc: Jerin Jacob, Nithin Dabilpuram, Kiran Kumar K, Sunil Kumar Kori,
	Satha Rao, Gowrishankar Muthukrishnan

Fix null pointer dereference reported in coverity scan.

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

Signed-off-by: Gowrishankar Muthukrishnan <gmuthukrishn@marvell.com>
---
 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


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] common/cnxk: fix null pointer dereference
  2022-04-24 16:17 [PATCH] common/cnxk: fix null pointer dereference Gowrishankar Muthukrishnan
@ 2022-05-05  8:34 ` Jerin Jacob
  0 siblings, 0 replies; 2+ messages in thread
From: Jerin Jacob @ 2022-05-05  8:34 UTC (permalink / raw)
  To: Gowrishankar Muthukrishnan, Ferruh Yigit, Andrew Rybchenko
  Cc: dpdk-dev, Jerin Jacob, Nithin Dabilpuram, Kiran Kumar K,
	Sunil Kumar Kori, Satha Rao

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

Cc: stable@dpdk.org

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

Acked-by: Jerin Jacob <jerinj@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
>

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2022-05-05  8:34 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-04-24 16:17 [PATCH] common/cnxk: fix null pointer dereference Gowrishankar Muthukrishnan
2022-05-05  8:34 ` Jerin Jacob

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).