aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJakub Kicinski <[email protected]>2017-10-30 13:46:47 -0700
committerDavid S. Miller <[email protected]>2017-10-31 09:18:04 +0900
commitaa2bc739ef4a181a7589eb009be96a870cc1788f (patch)
treee5108eb9540716c493efef696228da791bee0b89
parente1ea2f9856b765a2eaabb403a6751f70efc9ba4c (diff)
net: filter: remove unused variable and fix warning
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 <[email protected]> Reviewed-by: Quentin Monnet <[email protected]> Acked-by: Lawrence Brakmo <[email protected]> Acked-by: Daniel Borkmann <[email protected]> Acked-by: Alexei Starovoitov <[email protected]> Signed-off-by: David S. Miller <[email protected]>
-rw-r--r--net/core/filter.c3
1 files changed, 1 insertions, 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);