mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2024-11-25 13:14:07 +08:00
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:
parent
ec2ffdf65f
commit
a4fa458950
@ -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)) {
|
||||
|
Loading…
Reference in New Issue
Block a user