[2/2] common/cnxk: fix uninitialized pointer read

Message ID 20230518100452.2190793-2-psatheesh@marvell.com (mailing list archive)
State Accepted, archived
Delegated to: Jerin Jacob
Headers
Series [1/2] common/cnxk: fix setting channel mask for SDP interfaces |

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/loongarch-compilation success Compilation OK
ci/loongarch-unit-testing success Unit Testing PASS
ci/Intel-compilation success Compilation OK
ci/intel-Testing success Testing PASS
ci/iol-mellanox-Performance success Performance Testing PASS
ci/iol-intel-Functional success Functional Testing PASS
ci/iol-broadcom-Functional success Functional Testing PASS
ci/iol-intel-Performance success Performance Testing PASS
ci/iol-broadcom-Performance success Performance Testing PASS
ci/iol-aarch64-unit-testing success Testing PASS
ci/iol-abi-testing success Testing PASS
ci/iol-unit-testing success Testing PASS
ci/intel-Functional success Functional PASS
ci/github-robot: build success github build: passed
ci/iol-aarch64-compile-testing success Testing PASS
ci/iol-x86_64-compile-testing success Testing PASS
ci/iol-testing success Testing PASS
ci/iol-x86_64-unit-testing success Testing PASS

Commit Message

Satheesh Paul Antonysamy May 18, 2023, 10:04 a.m. UTC
  From: Satheesh Paul <psatheesh@marvell.com>

Fix uninitialized pointer read reported in coverity scan.

Coverity issue: 375811
Fixes: 84d2ea9d4fb3 ("common/cnxk: support custom pre L2 header parsing as raw")
Cc: stable@dpdk.org

Signed-off-by: Satheesh Paul <psatheesh@marvell.com>
Reviewed-by: Kiran Kumar K <kirankumark@marvell.com>
---
 drivers/common/cnxk/roc_npc_parse.c | 1 +
 1 file changed, 1 insertion(+)
  

Comments

Jerin Jacob May 22, 2023, 1:55 p.m. UTC | #1
On Thu, May 18, 2023 at 3:35 PM <psatheesh@marvell.com> wrote:
>
> From: Satheesh Paul <psatheesh@marvell.com>
>
> Fix uninitialized pointer read reported in coverity scan.
>
> Coverity issue: 375811
> Fixes: 84d2ea9d4fb3 ("common/cnxk: support custom pre L2 header parsing as raw")
> Cc: stable@dpdk.org
>
> Signed-off-by: Satheesh Paul <psatheesh@marvell.com>
> Reviewed-by: Kiran Kumar K <kirankumark@marvell.com>

Series applied to dpdk-next-net-mrvl/for-next-net. Thanks


> ---
>  drivers/common/cnxk/roc_npc_parse.c | 1 +
>  1 file changed, 1 insertion(+)
>
> diff --git a/drivers/common/cnxk/roc_npc_parse.c b/drivers/common/cnxk/roc_npc_parse.c
> index f746b9cb6d..571fdb36fc 100644
> --- a/drivers/common/cnxk/roc_npc_parse.c
> +++ b/drivers/common/cnxk/roc_npc_parse.c
> @@ -97,6 +97,7 @@ npc_parse_pre_l2(struct npc_parse_state *pst)
>                 (const struct roc_npc_flow_item_raw *)pst->pattern->mask, &info,
>                 raw_spec_buf, raw_mask_buf);
>
> +       info.def_mask = NULL;
>         info.hw_mask = &hw_mask;
>         npc_get_hw_supp_mask(pst, &info, lid, lt);
>
> --
> 2.39.2
>
  

Patch

diff --git a/drivers/common/cnxk/roc_npc_parse.c b/drivers/common/cnxk/roc_npc_parse.c
index f746b9cb6d..571fdb36fc 100644
--- a/drivers/common/cnxk/roc_npc_parse.c
+++ b/drivers/common/cnxk/roc_npc_parse.c
@@ -97,6 +97,7 @@  npc_parse_pre_l2(struct npc_parse_state *pst)
 		(const struct roc_npc_flow_item_raw *)pst->pattern->mask, &info,
 		raw_spec_buf, raw_mask_buf);
 
+	info.def_mask = NULL;
 	info.hw_mask = &hw_mask;
 	npc_get_hw_supp_mask(pst, &info, lid, lt);