Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

hostap: Add missing annotations for prism2_bss_list_proc_start() and prism2_bss_list_proc_stop

Sparse reports warnings at prism2_bss_list_proc_start() and prism2_bss_list_proc_stop()

warning: context imbalance in prism2_wds_proc_stop() - unexpected unlock
warning: context imbalance in prism2_bss_list_proc_start() - wrong count at exit

The root cause is the missing annotations at prism2_bss_list_proc_start()

Add the missing __acquires(&local->lock) annotation
Add the missing __releases(&local->lock) annotation

Signed-off-by: Jules Irenge <jbi.octave@gmail.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Link: https://lore.kernel.org/r/20200411001933.10072-4-jbi.octave@gmail.com

authored by

Jules Irenge and committed by
Kalle Valo
1c0e3c73 297bcf82

+2
+2
drivers/net/wireless/intersil/hostap/hostap_proc.c
··· 149 149 } 150 150 151 151 static void *prism2_bss_list_proc_start(struct seq_file *m, loff_t *_pos) 152 + __acquires(&local->lock) 152 153 { 153 154 local_info_t *local = PDE_DATA(file_inode(m->file)); 154 155 spin_lock_bh(&local->lock); ··· 163 162 } 164 163 165 164 static void prism2_bss_list_proc_stop(struct seq_file *m, void *v) 165 + __releases(&local->lock) 166 166 { 167 167 local_info_t *local = PDE_DATA(file_inode(m->file)); 168 168 spin_unlock_bh(&local->lock);