projects
/
openwrt
/
staging
/
blogic.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
e1ea2f9
)
net: filter: remove unused variable and fix warning
author
Jakub Kicinski
<
[email protected]
>
Mon, 30 Oct 2017 20:46:47 +0000
(13:46 -0700)
committer
David S. Miller
<
[email protected]
>
Tue, 31 Oct 2017 00:18:04 +0000
(09:18 +0900)
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]
>
net/core/filter.c
patch
|
blob
|
history
diff --git
a/net/core/filter.c
b/net/core/filter.c
index 721c3088903390c0de85c8353a090324cf800a56..a0112168d6f9bfdf624b9a6ae772c8a0221e7050 100644
(file)
--- 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);