netpoll: fix an uninitialized variable
Subsystems (2)
PATCH 1/1 netpoll: fix an uninitialized variable
From: Cong Wang <[email protected]>
Fengguang reported:
net/core/netpoll.c: In function 'netpoll_setup':
net/core/netpoll.c:1049:6: warning: 'err' may be used uninitialized in this function [-Wmaybe-uninitialized]
in !CONFIG_IPV6 case, we may error out without initializing 'err'.
Reported-by Fengguang Wu <[email protected]>
Cc David S. Miller <[email protected]>
Signed-off-by Cong Wang <[email protected]>
---
net/core/netpoll.c +1 -0
@@ -1140,6 +1140,7 @@ int netpoll_setup(struct netpoll *np)#else np_err (np,"IPv6 is not supported %s, aborting\n" , np->dev_name); + err = -EINVAL ; goto put;#endif }
From: Cong Wang <[email protected]>
Date: Wed, 23 Jan 2013 11:39:11 +0800
Quoted 7 lines
From: Cong Wang <[email protected]>
Fengguang reported:
net/core/netpoll.c: In function 'netpoll_setup':
net/core/netpoll.c:1049:6: warning: 'err' may be used uninitialized in this function [-Wmaybe-uninitialized]
Quoted 6 lines
in !CONFIG_IPV6 case, we may error out without initializing 'err'.
Reported-by Fengguang Wu <[email protected]>Cc David S. Miller <[email protected]>Signed-off-by Cong Wang <[email protected]>
Applied.