Skip to content

Commit a4fa458

Browse files
author
Alexei Starovoitov
committed
bpfilter: Initialize pos variable
Make sure 'pos' is initialized to zero before calling kernel_write(). Fixes: d2ba09c ("net: add skeleton of bpfilter kernel module") Signed-off-by: Alexei Starovoitov <ast@kernel.org>
1 parent ec2ffdf commit a4fa458

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

‎net/bpfilter/bpfilter_kern.c‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ static int __bpfilter_process_sockopt(struct sock *sk, int optname,
4848
req.len = optlen;
4949
if (!bpfilter_ops.info.tgid)
5050
goto out;
51+
pos = 0;
5152
n = kernel_write(bpfilter_ops.info.pipe_to_umh, &req, sizeof(req),
5253
&pos);
5354
if (n != sizeof(req)) {

0 commit comments

Comments
 (0)