From: John Fastabend <john.fastabend@gmail.com>
To: daniel@iogearbox.net, davem@davemloft.net,
eric.dumazet@gmail.com, dsahern@gmail.com
Cc: netdev@vger.kernel.org, john.fastabend@gmail.com
Subject: [net-next PATCH 1/2] bpf: sockmap state change warning fix
Date: Wed, 16 Aug 2017 15:02:12 -0700 [thread overview]
Message-ID: <20170816220211.25438.24547.stgit@john-Precision-Tower-5810> (raw)
In-Reply-To: <20170816220049.25438.62373.stgit@john-Precision-Tower-5810>
psock will uninitialized in default case we need to do the same psock lookup
and check as in other branch. Fixes compile warning below.
kernel/bpf/sockmap.c: In function ‘smap_state_change’:
kernel/bpf/sockmap.c:156:21: warning: ‘psock’ may be used uninitialized in this function [-Wmaybe-uninitialized]
struct smap_psock *psock;
Fixes: 174a79ff9515 ("bpf: sockmap with sk redirect support")
Reported-by: David Miller <davem@davemloft.net>
Signed-off-by: John Fastabend <john.fastabend@gmail.com>
---
kernel/bpf/sockmap.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/kernel/bpf/sockmap.c b/kernel/bpf/sockmap.c
index 792f0ad..f7e5e6c 100644
--- a/kernel/bpf/sockmap.c
+++ b/kernel/bpf/sockmap.c
@@ -188,6 +188,9 @@ static void smap_state_change(struct sock *sk)
smap_release_sock(sk);
break;
default:
+ psock = smap_psock_sk(sk);
+ if (unlikely(!psock))
+ break;
smap_report_sk_error(psock, EPIPE);
break;
}
next prev parent reply other threads:[~2017-08-16 22:02 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-08-16 22:01 [net-next PATCH 0/2] bpf: sockmap build fixes John Fastabend
2017-08-16 22:02 ` John Fastabend [this message]
2017-08-16 22:10 ` [net-next PATCH 1/2] bpf: sockmap state change warning fix Daniel Borkmann
2017-08-16 22:02 ` [net-next PATCH 2/2] bpf: sock_map fixes for !CONFIG_BPF_SYSCALL and !STREAM_PARSER John Fastabend
2017-08-16 22:06 ` David Ahern
2017-08-16 22:20 ` John Fastabend
2017-08-16 22:11 ` Daniel Borkmann
2017-08-16 22:35 ` [net-next PATCH 0/2] bpf: sockmap build fixes David Miller
2017-08-16 22:42 ` David Miller
2017-08-16 22:58 ` John Fastabend
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20170816220211.25438.24547.stgit@john-Precision-Tower-5810 \
--to=john.fastabend@gmail.com \
--cc=daniel@iogearbox.net \
--cc=davem@davemloft.net \
--cc=dsahern@gmail.com \
--cc=eric.dumazet@gmail.com \
--cc=netdev@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox