CRED: Restore const to current_cred()
Commit 3295514841 ("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>
	
	
This commit is contained in:
		
					parent
					
						
							
								322a8b0340
							
						
					
				
			
			
				commit
				
					
						27e4e43627
					
				
			
		
					 1 changed files with 1 additions and 1 deletions
				
			
		| 
						 | 
				
			
			@ -269,7 +269,7 @@ static inline void put_cred(const struct cred *_cred)
 | 
			
		|||
 * since nobody else can modify it.
 | 
			
		||||
 */
 | 
			
		||||
#define current_cred() \
 | 
			
		||||
	(*(__force struct cred **)¤t->cred)
 | 
			
		||||
	rcu_dereference_protected(current->cred, 1)
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * __task_cred - Access a task's objective credentials
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue