diff options
author | David Howells <dhowells@redhat.com> | 2011-08-08 10:54:53 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2011-08-08 12:03:16 -0400 |
commit | 27e4e4362756a78b15e83ef104c8bbe257f40f90 (patch) | |
tree | e94ce9e5540cc8e2ae9a06aa398bc16a364c29b2 /include/linux | |
parent | 322a8b034003c0d46d39af85bf24fee27b902f48 (diff) |
CRED: Restore const to current_cred()
Commit 3295514841c2 ("fix rcu annotations noise in cred.h") accidentally
dropped the const of current->cred inside current_cred() by the
insertion of a cast to deal with an RCU annotation loss warning from
sparce.
Use an appropriate RCU wrapper instead so as not to lose the const.
Signed-off-by: David Howells <dhowells@redhat.com>
Reviewed-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
cc: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'include/linux')
-rw-r--r-- | include/linux/cred.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/include/linux/cred.h b/include/linux/cred.h index 98f46efbe2d2..8e2fd44eb160 100644 --- a/include/linux/cred.h +++ b/include/linux/cred.h | |||
@@ -269,7 +269,7 @@ static inline void put_cred(const struct cred *_cred) | |||
269 | * since nobody else can modify it. | 269 | * since nobody else can modify it. |
270 | */ | 270 | */ |
271 | #define current_cred() \ | 271 | #define current_cred() \ |
272 | (*(__force struct cred **)¤t->cred) | 272 | rcu_dereference_protected(current->cred, 1) |
273 | 273 | ||
274 | /** | 274 | /** |
275 | * __task_cred - Access a task's objective credentials | 275 | * __task_cred - Access a task's objective credentials |