[PATCH] tipc: eliminate uninitialized variable warning

Subsystems: networking [general], the rest, tipc network layer

STALE3702d REVIEWED: 1 (0M)

1 review trailer.

2 messages, 2 authors, 2016-06-16 · open the first message on its own page

[PATCH] tipc: eliminate uninitialized variable warning

From: Ying Xue <hidden>
Date: 2016-06-15 06:12:01

net/tipc/link.c: In function ‘tipc_link_timeout’:
net/tipc/link.c:744:28: warning: ‘mtyp’ may be used uninitialized in this function [-Wuninitialized]

Fixes: 42b18f605fea ("tipc: refactor function tipc_link_timeout()")
Acked-by: Jon Maloy <redacted>
Signed-off-by: Ying Xue <redacted>
---
 net/tipc/link.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/net/tipc/link.c b/net/tipc/link.c
index 7059c94..67b6ab9 100644
--- a/net/tipc/link.c
+++ b/net/tipc/link.c
@@ -704,7 +704,8 @@ static void link_profile_stats(struct tipc_link *l)
  */
 int tipc_link_timeout(struct tipc_link *l, struct sk_buff_head *xmitq)
 {
-	int mtyp, rc = 0;
+	int mtyp = 0;
+	int rc = 0;
 	bool state = false;
 	bool probe = false;
 	bool setup = false;
-- 
1.7.9.5

Re: [PATCH] tipc: eliminate uninitialized variable warning

From: David Miller <davem@davemloft.net>
Date: 2016-06-16 04:47:54

From: Ying Xue <redacted>
Date: Wed, 15 Jun 2016 14:11:31 +0800
net/tipc/link.c: In function ‘tipc_link_timeout’:
net/tipc/link.c:744:28: warning: ‘mtyp’ may be used uninitialized in this function [-Wuninitialized]

Fixes: 42b18f605fea ("tipc: refactor function tipc_link_timeout()")
Acked-by: Jon Maloy <redacted>
Signed-off-by: Ying Xue <redacted>
Applied.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help