UPSTREAM: bpfilter: Initialize pos variable

Make sure 'pos' is initialized to zero before calling kernel_write().

Fixes: d2ba09c17a ("net: add skeleton of bpfilter kernel module")
Change-Id: I7d7e53e5e18f9ee05fb5a30b9629a3e09af1c913
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Signed-off-by: Tashfin Shakeer Rhythm <tashfinshakeerrhythm@gmail.com>
This commit is contained in:
Alexei Starovoitov 2020-07-14 12:31:45 -07:00 • committed by basamaryan
commit 0fc6df7760
No known key found for this signature in database
GPG key ID: 210D5384FB2A5885

View file

@ -48,6 +48,7 @@ static int __bpfilter_process_sockopt(struct sock *sk, int optname,
req.len = optlen;
if (!bpfilter_ops.info.tgid)
goto out;
pos = 0;
n = kernel_write(bpfilter_ops.info.pipe_to_umh, &req, sizeof(req),
&pos);
if (n != sizeof(req)) {