mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Shaohua Li <shli@fb.com>
To: <linux-kernel@vger.kernel.org>, <netdev@vger.kernel.org>
Cc: "David S . Miller" <davem@davemloft.net>,
	<akpm@linux-foundation.org>, Tejun Heo <tj@kernel.org>,
	Alexei Starovoitov <ast@kernel.org>
Subject: [PATCH trival -resend 1/2] bpf: clean up put_cpu_var usage
Date: Tue, 27 Sep 2016 08:42:41 -0700	[thread overview]
Message-ID: <7ffd1960225e024a738e4c372f091bb49096e294.1474990741.git.shli@fb.com> (raw)

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@kernel.org>
Cc: Alexei Starovoitov <ast@kernel.org>
Signed-off-by: Shaohua Li <shli@fb.com>
---
 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 7b7baae..aa6d981 100644
--- a/kernel/bpf/core.c
+++ b/kernel/bpf/core.c
@@ -1031,7 +1031,7 @@ BPF_CALL_0(bpf_user_rnd_u32)
 
 	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

             reply	other threads:[~2016-09-27 15:43 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-09-27 15:42 Shaohua Li [this message]
2016-09-27 15:42 ` [PATCH trival -resend 2/2] lib: " Shaohua Li
2016-09-27 23:16   ` Tejun Heo
2016-09-28  2:10   ` David Miller
2016-09-27 23:02 ` [PATCH trival -resend 1/2] bpf: " Alexei Starovoitov
2016-09-27 23:15 ` Tejun Heo
2016-09-28  2:10 ` David Miller

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=7ffd1960225e024a738e4c372f091bb49096e294.1474990741.git.shli@fb.com \
    --to=shli@fb.com \
    --cc=akpm@linux-foundation.org \
    --cc=ast@kernel.org \
    --cc=davem@davemloft.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=tj@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®