lkml.org 
[lkml]   [2017]   [Jun]   [26]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH] netfilter: ip_tables: remove useless variable assignment in get_info()
From
Date
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;
> }

\
 
 \ /
  Last update: 2017-06-27 04:47    [W:0.059 / U:0.228 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site