* [PATCH 2/2] bpf: sockmap, potential uninitialized return in __sock_map_ctx_update_elem()
@ 2018-05-18 7:58 Dan Carpenter
0 siblings, 0 replies; only message in thread
From: Dan Carpenter @ 2018-05-18 7:58 UTC (permalink / raw)
To: Alexei Starovoitov, John Fastabend
Cc: Daniel Borkmann, netdev, kernel-janitors
Smatch complains that "err" might be uninitialized. That seems
possible. Anyway we can just return zero.
Fixes: e5cd3abcb31a ("bpf: sockmap, refactor sockmap routines to work with hashmap")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
diff --git a/kernel/bpf/sockmap.c b/kernel/bpf/sockmap.c
index c6de1393df63..6298adb3162a 100644
--- a/kernel/bpf/sockmap.c
+++ b/kernel/bpf/sockmap.c
@@ -1821,7 +1821,7 @@ static int __sock_map_ctx_update_elem(struct bpf_map *map,
list_add_tail(&e->list, &psock->maps);
}
write_unlock_bh(&sock->sk_callback_lock);
- return err;
+ return 0;
out_free:
kfree(e);
smap_release_sock(psock, sock);
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2018-05-18 7:59 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-05-18 7:58 [PATCH 2/2] bpf: sockmap, potential uninitialized return in __sock_map_ctx_update_elem() Dan Carpenter
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).