[PATCH] Fix coverity issue 'Uninitialized scalar variable"

Subsystems: atmel macb ethernet driver, networking drivers, the rest

STALE1720d

2 messages, 2 authors, 2021-11-22 · open the first message on its own page

[PATCH] Fix coverity issue 'Uninitialized scalar variable"

From: Yacov Simhony <hidden>
Date: 2021-11-21 15:03:00

There are three boolean variable which were not initialized and later
being used in the code.

Signed-off-by: Yacov Simhony <redacted>
---
 drivers/net/ethernet/cadence/macb_main.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/net/ethernet/cadence/macb_main.c b/drivers/net/ethernet/cadence/macb_main.c
index 57c5f48..d23c3f6 100644
--- a/drivers/net/ethernet/cadence/macb_main.c
+++ b/drivers/net/ethernet/cadence/macb_main.c
@@ -513,7 +513,7 @@ static void macb_validate(struct phylink_config *config,
 	struct net_device *ndev = to_net_dev(config->dev);
 	__ETHTOOL_DECLARE_LINK_MODE_MASK(mask) = { 0, };
 	struct macb *bp = netdev_priv(ndev);
-	bool have_1g, have_sgmii, have_10g;
+	bool have_1g=false, have_sgmii=false, have_10g=false;
 
 	/* Determine what modes are supported */
 	if (macb_is_gem(bp) &&
-- 
2.7.4

Re: [PATCH] Fix coverity issue 'Uninitialized scalar variable"

From: patchwork-bot+netdevbpf@kernel.org
Date: 2021-11-22 14:30:15

Hello:

This patch was applied to netdev/net-next.git (master)
by David S. Miller [off-list ref]:

On Sun, 21 Nov 2021 17:02:53 +0200 you wrote:
There are three boolean variable which were not initialized and later
being used in the code.

Signed-off-by: Yacov Simhony <redacted>
---
 drivers/net/ethernet/cadence/macb_main.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
Here is the summary with links:
  - Fix coverity issue 'Uninitialized scalar variable"
    https://git.kernel.org/netdev/net-next/c/ac9f66ff04a9

You are awesome, thank you!
-- 
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html

Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help