Skip to contentSkip to conversation

netpoll: fix an uninitialized variable

PATCH Applied Cong Wang 2 participants 2 messages Jan 23, 2013

Subsystems (2)
lore
Share & tools
lore

Cong Wang

author
#0 lore raw

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'.

---

net/core/netpoll.c +1 -0
index a9b1004..e2f79a1 100644
@@ -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
 		}
maintainer Applied
#1 lore raw

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'.

Applied.