net/cnxk: fix uninitialized local variable

Message ID 20220212124100.3394466-1-gmuthukrishn@marvell.com (mailing list archive)
State Accepted, archived
Delegated to: Jerin Jacob
Headers
Series net/cnxk: fix uninitialized local variable |

Checks

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

Commit Message

Gowrishankar Muthukrishnan Feb. 12, 2022, 12:41 p.m. UTC
  Fix uninitialized local variable as reported by coverity scan.

Fixes: 6af19a9d89b ("net/cnxk: support meter action to flow destroy")
Coverity issue: 373630

Signed-off-by: Gowrishankar Muthukrishnan <gmuthukrishn@marvell.com>
---
 drivers/net/cnxk/cnxk_ethdev.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
  

Comments

Jerin Jacob Feb. 18, 2022, 4:56 a.m. UTC | #1
On Sat, Feb 12, 2022 at 6:11 PM Gowrishankar Muthukrishnan
<gmuthukrishn@marvell.com> wrote:
>
> Fix uninitialized local variable as reported by coverity scan.
>
> Fixes: 6af19a9d89b ("net/cnxk: support meter action to flow destroy")
> Coverity issue: 373630
>
> 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/net/cnxk/cnxk_ethdev.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/net/cnxk/cnxk_ethdev.c b/drivers/net/cnxk/cnxk_ethdev.c
> index 945600cdaf..62ffb65cc2 100644
> --- a/drivers/net/cnxk/cnxk_ethdev.c
> +++ b/drivers/net/cnxk/cnxk_ethdev.c
> @@ -177,7 +177,7 @@ nix_meter_fini(struct cnxk_eth_dev *dev)
>         struct roc_nix *nix = &dev->nix;
>         struct roc_nix_rq *rq;
>         uint32_t i;
> -       int rc;
> +       int rc = 0;
>
>         RTE_TAILQ_FOREACH_SAFE(mtr, fms, next, next_mtr) {
>                 for (i = 0; i < mtr->rq_num; i++) {
> --
> 2.25.1
>
  

Patch

diff --git a/drivers/net/cnxk/cnxk_ethdev.c b/drivers/net/cnxk/cnxk_ethdev.c
index 945600cdaf..62ffb65cc2 100644
--- a/drivers/net/cnxk/cnxk_ethdev.c
+++ b/drivers/net/cnxk/cnxk_ethdev.c
@@ -177,7 +177,7 @@  nix_meter_fini(struct cnxk_eth_dev *dev)
 	struct roc_nix *nix = &dev->nix;
 	struct roc_nix_rq *rq;
 	uint32_t i;
-	int rc;
+	int rc = 0;
 
 	RTE_TAILQ_FOREACH_SAFE(mtr, fms, next, next_mtr) {
 		for (i = 0; i < mtr->rq_num; i++) {