[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20160926235157.GB58431@ast-mbp.thefacebook.com>
Date: Mon, 26 Sep 2016 16:51:59 -0700
From: Alexei Starovoitov <alexei.starovoitov@...il.com>
To: Shaohua Li <shli@...com>
Cc: linux-kernel@...r.kernel.org, akpm@...ux-foundation.org,
Tejun Heo <tj@...nel.org>, Alexei Starovoitov <ast@...nel.org>,
Daniel Borkmann <daniel@...earbox.net>
Subject: Re: [PATCH trival 1/2] bpf: clean up put_cpu_var usage
On Mon, Sep 26, 2016 at 11:14:50AM -0700, Shaohua Li wrote:
> put_cpu_var takes the percpu data, not the data returned from
> get_cpu_var.
>
> This doesn't change the behavior.
>
> Cc: Tejun Heo <tj@...nel.org>
> Cc: Alexei Starovoitov <ast@...nel.org>
> Signed-off-by: Shaohua Li <shli@...com>
Looks good. Nice catch.
Please rebase to net-next tree and send it to netdev list.
Otherwise we'll have conflicts at the time of the merge window.
> ---
> kernel/bpf/core.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/kernel/bpf/core.c b/kernel/bpf/core.c
> index 03fd23d..b73913b 100644
> --- a/kernel/bpf/core.c
> +++ b/kernel/bpf/core.c
> @@ -1031,7 +1031,7 @@ u64 bpf_user_rnd_u32(u64 r1, u64 r2, u64 r3, u64 r4, u64 r5)
>
> state = &get_cpu_var(bpf_user_rnd_state);
> res = prandom_u32_state(state);
> - put_cpu_var(state);
> + put_cpu_var(bpf_user_rnd_state);
>
> return res;
> }
> --
> 2.9.3
>
Powered by blists - more mailing lists