netfilter: ctnetlink: fix gcc warning during compilation
authorPablo Neira Ayuso <pablo@netfilter.org>
Wed, 22 Apr 2009 09:26:37 +0000 (02:26 -0700)
committerDavid S. Miller <davem@davemloft.net>
Wed, 22 Apr 2009 09:26:37 +0000 (02:26 -0700)
This patch fixes a (bogus?) gcc warning during compilation:

net/netfilter/nf_conntrack_netlink.c:1234: warning: 'helpname' may be used uninitialized in this function
net/netfilter/nf_conntrack_netlink.c:991: warning: 'helpname' may be used uninitialized in this function

In fact, helpname is initialized by ctnetlink_parse_help() so
I cannot see a way to use it without being initialized.

Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/netfilter/nf_conntrack_netlink.c

index 0ea36e0c8a0e1b08c13d2f53239bc1633aef03d6..f13fc57e1ecbe14b1a479b00117305b82f1c5702 100644 (file)
@@ -988,7 +988,7 @@ ctnetlink_change_helper(struct nf_conn *ct, struct nlattr *cda[])
 {
        struct nf_conntrack_helper *helper;
        struct nf_conn_help *help = nfct_help(ct);
-       char *helpname;
+       char *helpname = NULL;
        int err;
 
        /* don't change helper of sibling connections */
@@ -1231,7 +1231,7 @@ ctnetlink_create_conntrack(struct nlattr *cda[],
 
        rcu_read_lock();
        if (cda[CTA_HELP]) {
-               char *helpname;
+               char *helpname = NULL;
  
                err = ctnetlink_parse_help(cda[CTA_HELP], &helpname);
                if (err < 0)