* Re: warnings in current tree [not found] <20090421.014357.219275555.davem@davemloft.net> @ 2009-04-21 8:44 ` David Miller 2009-04-21 10:54 ` Pablo Neira Ayuso 0 siblings, 1 reply; 3+ messages in thread From: David Miller @ 2009-04-21 8:44 UTC (permalink / raw) To: netfilter; +Cc: netfilter-devel From: David Miller <davem@davemloft.net> Date: Tue, 21 Apr 2009 01:43:57 -0700 (PDT) Sorry, duh, meant netfilter-devel :-) > Can someone fix these up? Thanks! > > 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 > -- > To unsubscribe from this list: send the line "unsubscribe netfilter" in > the body of a message to majordomo@vger.kernel.org > More majordomo info at http://vger.kernel.org/majordomo-info.html ^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: warnings in current tree 2009-04-21 8:44 ` warnings in current tree David Miller @ 2009-04-21 10:54 ` Pablo Neira Ayuso 2009-04-22 9:27 ` David Miller 0 siblings, 1 reply; 3+ messages in thread From: Pablo Neira Ayuso @ 2009-04-21 10:54 UTC (permalink / raw) To: David Miller; +Cc: netfilter, netfilter-devel [-- Attachment #1: Type: text/plain, Size: 637 bytes --] Hi David! David Miller wrote: > From: David Miller <davem@davemloft.net> > Date: Tue, 21 Apr 2009 01:43:57 -0700 (PDT) > > Sorry, duh, meant netfilter-devel :-) > >> Can someone fix these up? Thanks! >> >> 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 Hm, weird, is this a "bogus punch"? I don't remember to have seen those here and that code has not been modified recently. Anyway, patch attached :). -- "Los honestos son inadaptados sociales" -- Les Luthiers [-- Attachment #2: ctnl-fix-warning-gcc.patch --] [-- Type: text/x-diff, Size: 1384 bytes --] netfilter: ctnetlink: fix gcc warning during compilation From: Pablo Neira Ayuso <pablo@netfilter.org> 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> --- net/netfilter/nf_conntrack_netlink.c | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/net/netfilter/nf_conntrack_netlink.c b/net/netfilter/nf_conntrack_netlink.c index 0ea36e0..fcf6e3b 100644 --- a/net/netfilter/nf_conntrack_netlink.c +++ b/net/netfilter/nf_conntrack_netlink.c @@ -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) ^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: warnings in current tree 2009-04-21 10:54 ` Pablo Neira Ayuso @ 2009-04-22 9:27 ` David Miller 0 siblings, 0 replies; 3+ messages in thread From: David Miller @ 2009-04-22 9:27 UTC (permalink / raw) To: pablo; +Cc: netfilter, netfilter-devel From: Pablo Neira Ayuso <pablo@netfilter.org> Date: Tue, 21 Apr 2009 12:54:06 +0200 > Hi David! > > David Miller wrote: >> From: David Miller <davem@davemloft.net> >> Date: Tue, 21 Apr 2009 01:43:57 -0700 (PDT) >> >> Sorry, duh, meant netfilter-devel :-) >> >>> Can someone fix these up? Thanks! >>> >>> 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 > > Hm, weird, is this a "bogus punch"? I don't remember to have seen those > here and that code has not been modified recently. > > Anyway, patch attached :). Applied, thanks :-) The problem is when you pass the address of a local variable to a function, which is then inlined and has non-trivial control flow (as far as GCC is concerned), and this is the way the variable is initialized. ^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2009-04-22 9:27 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <20090421.014357.219275555.davem@davemloft.net>
2009-04-21 8:44 ` warnings in current tree David Miller
2009-04-21 10:54 ` Pablo Neira Ayuso
2009-04-22 9:27 ` David Miller
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for NNTP newsgroup(s).