mirror of
				https://github.com/torvalds/linux.git
				synced 2025-10-31 16:48:26 +02:00 
			
		
		
		
	printk: Add notation to console_srcu locking
kernel/printk/printk.c:284:5: sparse: sparse: context imbalance in
'console_srcu_read_lock' - wrong count at exit
include/linux/srcu.h:301:9: sparse: sparse: context imbalance in
'console_srcu_read_unlock' - unexpected unlock
Fixes: 6c4afa7914 ("printk: Prepare for SRCU console list protection")
Signed-off-by: John Ogness <john.ogness@linutronix.de>
Reviewed-by: Petr Mladek <pmladek@suse.com>
Acked-by: Paul E. McKenney <paulmck@kernel.org>
Link: https://lore.kernel.org/r/20240820063001.36405-2-john.ogness@linutronix.de
Signed-off-by: Petr Mladek <pmladek@suse.com>
			
			
This commit is contained in:
		
							parent
							
								
									b0da640826
								
							
						
					
					
						commit
						eda25860bf
					
				
					 1 changed files with 2 additions and 0 deletions
				
			
		|  | @ -282,6 +282,7 @@ EXPORT_SYMBOL(console_list_unlock); | ||||||
|  * Return: A cookie to pass to console_srcu_read_unlock(). |  * Return: A cookie to pass to console_srcu_read_unlock(). | ||||||
|  */ |  */ | ||||||
| int console_srcu_read_lock(void) | int console_srcu_read_lock(void) | ||||||
|  | 	__acquires(&console_srcu) | ||||||
| { | { | ||||||
| 	return srcu_read_lock_nmisafe(&console_srcu); | 	return srcu_read_lock_nmisafe(&console_srcu); | ||||||
| } | } | ||||||
|  | @ -295,6 +296,7 @@ EXPORT_SYMBOL(console_srcu_read_lock); | ||||||
|  * Counterpart to console_srcu_read_lock() |  * Counterpart to console_srcu_read_lock() | ||||||
|  */ |  */ | ||||||
| void console_srcu_read_unlock(int cookie) | void console_srcu_read_unlock(int cookie) | ||||||
|  | 	__releases(&console_srcu) | ||||||
| { | { | ||||||
| 	srcu_read_unlock_nmisafe(&console_srcu, cookie); | 	srcu_read_unlock_nmisafe(&console_srcu, cookie); | ||||||
| } | } | ||||||
|  |  | ||||||
		Loading…
	
		Reference in a new issue
	
	 John Ogness
						John Ogness