bpfilter: Initialize pos variable

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

Fixes: d2ba09c17a ("net: add skeleton of bpfilter kernel module")
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
This commit is contained in:
Alexei Starovoitov 2020-07-14 12:31:45 -07:00
parent ec2ffdf65f
commit a4fa458950
1 changed files with 1 additions and 0 deletions

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)) {