Skip to content

Commit

Permalink
keys: fix user_defined key sparse messages
Browse files Browse the repository at this point in the history
Replace the rcu_assign_pointer() calls with rcu_assign_keypointer().

Signed-off-by: Mimi Zohar <[email protected]>
Signed-off-by: David Howells <[email protected]>
Signed-off-by: James Morris <[email protected]>
  • Loading branch information
Mimi Zohar authored and James Morris committed Jan 19, 2012
1 parent 3db59dd commit f6b2457
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions security/keys/user_defined.c
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ int user_instantiate(struct key *key, const void *data, size_t datalen)
/* attach the data */
upayload->datalen = datalen;
memcpy(upayload->data, data, datalen);
rcu_assign_pointer(key->payload.data, upayload);
rcu_assign_keypointer(key, upayload);
ret = 0;

error:
Expand Down Expand Up @@ -98,7 +98,7 @@ int user_update(struct key *key, const void *data, size_t datalen)
if (ret == 0) {
/* attach the new data, displacing the old */
zap = key->payload.data;
rcu_assign_pointer(key->payload.data, upayload);
rcu_assign_keypointer(key, upayload);
key->expiry = 0;
}

Expand Down Expand Up @@ -133,7 +133,7 @@ void user_revoke(struct key *key)
key_payload_reserve(key, 0);

if (upayload) {
rcu_assign_pointer(key->payload.data, NULL);
rcu_assign_keypointer(key, NULL);
kfree_rcu(upayload, rcu);
}
}
Expand Down

0 comments on commit f6b2457

Please sign in to comment.