[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <975C6474-B2CA-4AA3-B3C3-66CD41A72F36@fb.com>
Date: Mon, 30 Oct 2017 21:13:28 +0000
From: Lawrence Brakmo <brakmo@...com>
To: Jakub Kicinski <jakub.kicinski@...ronome.com>,
"netdev@...r.kernel.org" <netdev@...r.kernel.org>
CC: "oss-drivers@...ronome.com" <oss-drivers@...ronome.com>,
"alexei.starovoitov@...il.com" <alexei.starovoitov@...il.com>,
"daniel@...earbox.net" <daniel@...earbox.net>
Subject: Re: [PATCH net-next] net: filter: remove unused variable and fix
warning
Good catch, thanks!
On 10/30/17, 1:47 PM, "Jakub Kicinski" <jakub.kicinski@...ronome.com> wrote:
bpf_getsockopt bpf call sets the ret variable to zero and
never changes it. What's worse in case CONFIG_INET is
not selected the variable is completely unused generating
a warning.
Signed-off-by: Jakub Kicinski <jakub.kicinski@...ronome.com>
Reviewed-by: Quentin Monnet <quentin.monnet@...ronome.com>
Acked-by: Lawrence Brakmo <brakmo@...com>
---
net/core/filter.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/net/core/filter.c b/net/core/filter.c
index 721c30889033..a0112168d6f9 100644
--- a/net/core/filter.c
+++ b/net/core/filter.c
@@ -3288,7 +3288,6 @@ BPF_CALL_5(bpf_getsockopt, struct bpf_sock_ops_kern *, bpf_sock,
int, level, int, optname, char *, optval, int, optlen)
{
struct sock *sk = bpf_sock->sk;
- int ret = 0;
if (!sk_fullsock(sk))
goto err_clear;
@@ -3308,7 +3307,7 @@ BPF_CALL_5(bpf_getsockopt, struct bpf_sock_ops_kern *, bpf_sock,
} else {
goto err_clear;
}
- return ret;
+ return 0;
#endif
err_clear:
memset(optval, 0, optlen);
--
2.14.1
Powered by blists - more mailing lists