diff options
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) | |||
184 | struct user_key_payload *upayload; | 184 | struct user_key_payload *upayload; |
185 | long ret; | 185 | long ret; |
186 | 186 | ||
187 | upayload = rcu_dereference_protected( | 187 | upayload = rcu_dereference_key(key); |
188 | key->payload.data, rwsem_is_locked(&((struct key *)key)->sem)); | ||
189 | ret = upayload->datalen; | 188 | ret = upayload->datalen; |
190 | 189 | ||
191 | /* we can return the data as is */ | 190 | /* we can return the data as is */ |