netpoll: fix an uninitialized variable
authorCong Wang <amwang@redhat.com>
Tue, 22 Jan 2013 17:39:11 +0000 (17:39 +0000)
committerDavid S. Miller <davem@davemloft.net>
Wed, 23 Jan 2013 04:18:59 +0000 (23:18 -0500)
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 <fengguang.wu@intel.com>
Cc: David S. Miller <davem@davemloft.net>
Signed-off-by: Cong Wang <amwang@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/core/netpoll.c

index a9b10048388a31ebe3fd1c899a4c36a71534ab82..e2f79a14625c4bb718e3db82538febc8e6677ce1 100644 (file)
@@ -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
                }