diff options
author | David Howells <dhowells@redhat.com> | 2011-03-07 10:05:51 -0500 |
---|---|---|
committer | James Morris <jmorris@namei.org> | 2011-03-07 19:17:11 -0500 |
commit | 633e804e89464d3875e59de1959a53f9041d3094 (patch) | |
tree | 0a2464267c5f7a4e8166771fdc88e181a5b6219a /security/keys/trusted.c | |
parent | 1cc26bada9f6807814806db2f0d78792eecdac71 (diff) |
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/trusted.c')
-rw-r--r-- | security/keys/trusted.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/security/keys/trusted.c b/security/keys/trusted.c index 83fc92e297cd..c99b9368368c 100644 --- a/security/keys/trusted.c +++ b/security/keys/trusted.c | |||
@@ -1076,8 +1076,7 @@ static long trusted_read(const struct key *key, char __user *buffer, | |||
1076 | char *bufp; | 1076 | char *bufp; |
1077 | int i; | 1077 | int i; |
1078 | 1078 | ||
1079 | p = rcu_dereference_protected(key->payload.data, | 1079 | p = rcu_dereference_key(key); |
1080 | rwsem_is_locked(&((struct key *)key)->sem)); | ||
1081 | if (!p) | 1080 | if (!p) |
1082 | return -EINVAL; | 1081 | return -EINVAL; |
1083 | if (!buffer || buflen <= 0) | 1082 | if (!buffer || buflen <= 0) |