lkml.org 
[lkml]   [2021]   [Dec]   [30]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH linux] netfilter: Remove unnecessary ret assignment
Date
From: luo penghao <luo.penghao@zte.com.cn>

Regardless of whether the subsequent (copy_to_user(user, &info, *len) != 0)
holds, the value of ret will be assigned a new value.

The clang_analyzer complains as follows:

net/ipv6/netfilter/ip6_tables.c:

Value stored to 'ret' is never read

Reported-by: Zeal Robot <zealci@zte.com.cn>
Signed-off-by: luo penghao <luo.penghao@zte.com.cn>
---
net/ipv6/netfilter/ip6_tables.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/net/ipv6/netfilter/ip6_tables.c b/net/ipv6/netfilter/ip6_tables.c
index a579ea1..92b90a2 100644
--- a/net/ipv6/netfilter/ip6_tables.c
+++ b/net/ipv6/netfilter/ip6_tables.c
@@ -986,7 +986,7 @@ static int get_info(struct net *net, void __user *user, const int *len)
struct xt_table_info tmp;

if (in_compat_syscall()) {
- ret = compat_table_info(private, &tmp);
+ compat_table_info(private, &tmp);
xt_compat_flush_offsets(AF_INET6);
private = &tmp;
}
--
2.15.2

\
 
 \ /
  Last update: 2021-12-30 07:32    [W:0.032 / U:0.556 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site