Skip to contentSkip to conversation

net/cnxk: fix uninitialized local variable

PATCH Applied Gowrishankar Muthukrishnan 2 participants 2 messages Feb 12, 2022 – Feb 18, 2022 Network drivers

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 net/cnxk: fix uninitialized local variable

Fix uninitialized local variable as reported by coverity scan.

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

Coverity issue: 373630

---
 drivers/net/cnxk/cnxk_ethdev.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/cnxk/cnxk_ethdev.c +1 -1
index 945600cdaf..62ffb65cc2 100644
@@ -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++) {
Signature · 1 line
2.25.1
Acked-by on v1 1/1 Applied
#1 lore raw
Quoted 7 lines · Gowrishankar Muthukrishnan

Fix uninitialized local variable as reported by coverity scan.

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

Coverity issue: 373630

Applied to dpdk-next-net-mrvl/for-next-net. Thanks

Quoted 20 lines
---
 drivers/net/cnxk/cnxk_ethdev.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/cnxk/cnxk_ethdev.c +1 -2
index 945600cdaf..62ffb65cc2 100644
@@ -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