Thread (2 messages) flat view 2 messages, 2 authors, 2021-11-22
STALE1736d

[PATCH] Fix coverity issue 'Uninitialized scalar variable"

From: Yacov Simhony <hidden>
Date: 2021-11-21 15:03:00
Also in: lkml
Subsystem: atmel macb ethernet driver, networking drivers, the rest · Maintainers: Théo Lebrun, Andrew Lunn, "David S. Miller", Eric Dumazet, Jakub Kicinski, Paolo Abeni, Linus Torvalds

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
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help