diff options
author | David Howells <dhowells@redhat.com> | 2011-03-07 16:05:51 +0100 |
---|---|---|
committer | James Morris <jmorris@namei.org> | 2011-03-08 01:17:11 +0100 |
commit | 633e804e89464d3875e59de1959a53f9041d3094 (patch) | |
tree | 0a2464267c5f7a4e8166771fdc88e181a5b6219a /security/keys/user_defined.c | |
parent | Merge branch 'master'; commit 'v2.6.38-rc7' into next (diff) | |
download | linux-633e804e89464d3875e59de1959a53f9041d3094.tar.xz linux-633e804e89464d3875e59de1959a53f9041d3094.zip |
KEYS: Add an RCU payload dereference macro
Add an RCU payload dereference macro as this seems to be a common piece of code
amongst key types that use RCU referenced payloads.
Signed-off-by: David Howells <dhowells@redhat.com>
Signed-off-by: Mimi Zohar <zohar@us.ibm.com>
Signed-off-by: James Morris <jmorris@namei.org>
Diffstat (limited to 'security/keys/user_defined.c')
-rw-r--r-- | security/keys/user_defined.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/security/keys/user_defined.c b/security/keys/user_defined.c index 02807fb16340..c6ca8662a468 100644 --- a/security/keys/user_defined.c +++ b/security/keys/user_defined.c @@ -184,8 +184,7 @@ long user_read(const struct key *key, char __user *buffer, size_t buflen) struct user_key_payload *upayload; long ret; - upayload = rcu_dereference_protected( - key->payload.data, rwsem_is_locked(&((struct key *)key)->sem)); + upayload = rcu_dereference_key(key); ret = upayload->datalen; /* we can return the data as is */ |