diff mbox

tipc: eliminate uninitialized variable warning

Message ID 1465971091-16695-1-git-send-email-ying.xue@windriver.com
State Accepted, archived
Delegated to: David Miller
Headers show

Commit Message

Ying Xue June 15, 2016, 6:11 a.m. UTC
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 <jon.maloy@ericsson.com>
Signed-off-by: Ying Xue <ying.xue@windriver.com>
---
 net/tipc/link.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

Comments

David Miller June 16, 2016, 4:47 a.m. UTC | #1
From: Ying Xue <ying.xue@windriver.com>

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 <jon.maloy@ericsson.com>

> Signed-off-by: Ying Xue <ying.xue@windriver.com>


Applied.
diff mbox

Patch

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;