netfilter-devel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Pablo Neira Ayuso <pablo@netfilter.org>
To: David Miller <davem@davemloft.net>
Cc: netfilter@vger.kernel.org, netfilter-devel@vger.kernel.org
Subject: Re: warnings in current tree
Date: Tue, 21 Apr 2009 12:54:06 +0200	[thread overview]
Message-ID: <49EDA5CE.4010108@netfilter.org> (raw)
In-Reply-To: <20090421.014427.86938853.davem@davemloft.net>

[-- 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)

  reply	other threads:[~2009-04-21 10:54 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [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 [this message]
2009-04-22  9:27     ` David Miller

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=49EDA5CE.4010108@netfilter.org \
    --to=pablo@netfilter.org \
    --cc=davem@davemloft.net \
    --cc=netfilter-devel@vger.kernel.org \
    --cc=netfilter@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).