Skip to content

Commit

Permalink
driver core: Add missing annotation for device_links_write_lock()
Browse files Browse the repository at this point in the history
Sparse reports a warning at device_links_write_lock()

warning: context imbalance in evice_links_write_lock()
	 - wrong count at exit

The root cause is the missing annotation at device_links_write_lock()
Add the missing __acquires(&device_links_srcu) annotation

Signed-off-by: Jules Irenge <jbi.octave@gmail.com>
Link: https://lore.kernel.org/r/20200214204741.94112-19-jbi.octave@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
  • Loading branch information
Jules Irenge authored and Greg Kroah-Hartman committed Mar 4, 2020
1 parent ab7789c commit 68464d7
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/base/core.c
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ static inline void device_links_write_unlock(void)
mutex_unlock(&device_links_lock);
}

int device_links_read_lock(void)
int device_links_read_lock(void) __acquires(&device_links_srcu)
{
return srcu_read_lock(&device_links_srcu);
}
Expand Down

0 comments on commit 68464d7

Please sign in to comment.