Skip to contentSkip to conversation

octeontx2-af: returning uninitialized variable

PATCH Applied Sebin Sebastian 2 participants 2 messages Jul 13, 2022

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 octeontx2-af: returning uninitialized variable

Fix coverity error 'use of uninitialized variable'. err is uninitialized and is returned which can lead to unintended results. err has been replaced with -einval.
Coverity issue: 1518921 (uninitialized scalar variable)

---
 drivers/net/ethernet/marvell/octeontx2/af/rvu_npc_hash.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/ethernet/marvell/octeontx2/af/rvu_npc_hash.c +1 -1
index ed8b9afbf731..563bf1497fd0 100644
@@ -1961,7 +1961,7 @@ int rvu_npc_exact_init(struct rvu *rvu)
 			dev_err(rvu->dev,
 				"%s: failed to set drop info for cgx=%d, lmac=%d, chan=%llx\n",
 				__func__, cgx_id, lmac_id, chan_val);
-			return err;
+			return -EINVAL;
 		}
 
 		err = npc_install_mcam_drop_rule(rvu, *drop_mcam_idx,
Signature · 1 line
2.34.1
#1 lore raw
This patch was applied to netdev/net-next.git (master) by David S. Miller <[email protected]>:

Hello:

This patch was applied to netdev/net-next.git (master) by David S. Miller <[email protected]>:

Quoted 8 lines · On Wed, 13 Jul 2022 13:08:58 +0530 you wrote:

Fix coverity error 'use of uninitialized variable'. err is uninitialized and is returned which can lead to unintended results. err has been replaced with -einval.
Coverity issue: 1518921 (uninitialized scalar variable)

[...]

Here is the summary with links:
- [-next] octeontx2-af: returning uninitialized variable

    https://git.kernel.org/netdev/net-next/c/6a605eb1d71e

You are awesome, thank you!

Signature · 2 lines
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html