diff mbox series

[printk,v2,13/18] proc: consoles: Add notation to c_start/c_stop

Message ID 20240603232453.33992-14-john.ogness@linutronix.de (mailing list archive)
State New
Headers show
Series add threaded printing + the rest | expand

Commit Message

John Ogness June 3, 2024, 11:24 p.m. UTC
fs/proc/consoles.c:78:13: warning: context imbalance in 'c_start'
	- wrong count at exit
fs/proc/consoles.c:104:13: warning: context imbalance in 'c_stop'
	- unexpected unlock

Signed-off-by: John Ogness <john.ogness@linutronix.de>
---
 fs/proc/consoles.c | 2 ++
 1 file changed, 2 insertions(+)

Comments

Petr Mladek July 1, 2024, 3:43 p.m. UTC | #1
On Tue 2024-06-04 01:30:48, John Ogness wrote:
> fs/proc/consoles.c:78:13: warning: context imbalance in 'c_start'
> 	- wrong count at exit
> fs/proc/consoles.c:104:13: warning: context imbalance in 'c_stop'
> 	- unexpected unlock
> 
> Signed-off-by: John Ogness <john.ogness@linutronix.de>

Reviewed-by: Petr Mladek <pmladek@suse.com>

Best Regards,
Petr
diff mbox series

Patch

diff --git a/fs/proc/consoles.c b/fs/proc/consoles.c
index e0758fe7936d..7036fdfa0bec 100644
--- a/fs/proc/consoles.c
+++ b/fs/proc/consoles.c
@@ -68,6 +68,7 @@  static int show_console_dev(struct seq_file *m, void *v)
 }
 
 static void *c_start(struct seq_file *m, loff_t *pos)
+	__acquires(&console_mutex)
 {
 	struct console *con;
 	loff_t off = 0;
@@ -94,6 +95,7 @@  static void *c_next(struct seq_file *m, void *v, loff_t *pos)
 }
 
 static void c_stop(struct seq_file *m, void *v)
+	__releases(&console_mutex)
 {
 	console_list_unlock();
 }