All of lore.kernel.org
 help / color / mirror / Atom feed
From: Joe Perches <joe@perches.com>
To: "Gustavo A. R. Silva" <garsilva@embeddedor.com>,
	Pablo Neira Ayuso <pablo@netfilter.org>,
	Jozsef Kadlecsik <kadlec@blackhole.kfki.hu>,
	Florian Westphal <fw@strlen.de>,
	"David S. Miller" <davem@davemloft.net>,
	Alexey Kuznetsov <kuznet@ms2.inr.ac.ru>,
	James Morris <jmorris@namei.org>,
	Hideaki YOSHIFUJI <yoshfuji@linux-ipv6.org>,
	Patrick McHardy <kaber@trash.net>
Cc: netfilter-devel@vger.kernel.org, coreteam@netfilter.org,
	netdev@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] netfilter: ip_tables: remove useless variable assignment in get_info()
Date: Mon, 26 Jun 2017 19:46:58 -0700	[thread overview]
Message-ID: <1498531618.24295.57.camel@perches.com> (raw)
In-Reply-To: <20170626223428.GA11614@embeddedgus>

On Mon, 2017-06-26 at 17:34 -0500, Gustavo A. R. Silva wrote:
> Value assigned to variable _ret_ at line 970 is overwritten either at
> line 986 or 988, before it can be used. This makes such variable
> assignment useless.
> 
> Addresses-Coverity-ID: 1226932
[]
> diff --git a/net/ipv4/netfilter/ip_tables.c b/net/ipv4/netfilter/ip_tables.c
[]
> @@ -967,7 +967,7 @@ static int get_info(struct net *net, void __user *user,
>  		struct xt_table_info tmp;
>  
>  		if (compat) {
> -			ret = compat_table_info(private, &tmp);
> +			compat_table_info(private, &tmp);

why isn't it more appropriate to test the return value?

>  			xt_compat_flush_offsets(AF_INET);
>  			private = &tmp;
>  		}

  reply	other threads:[~2017-06-27  2:46 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-06-26 22:34 [PATCH] netfilter: ip_tables: remove useless variable assignment in get_info() Gustavo A. R. Silva
2017-06-27  2:46 ` Joe Perches [this message]
2017-06-27  3:42   ` Gustavo A. R. Silva

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=1498531618.24295.57.camel@perches.com \
    --to=joe@perches.com \
    --cc=coreteam@netfilter.org \
    --cc=davem@davemloft.net \
    --cc=fw@strlen.de \
    --cc=garsilva@embeddedor.com \
    --cc=jmorris@namei.org \
    --cc=kaber@trash.net \
    --cc=kadlec@blackhole.kfki.hu \
    --cc=kuznet@ms2.inr.ac.ru \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=netfilter-devel@vger.kernel.org \
    --cc=pablo@netfilter.org \
    --cc=yoshfuji@linux-ipv6.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.