Skip to content

Commit

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

warning:  warning: context imbalance in device_links_read_unlock()
	 - unexpected unlock

The root cause is the missing annotation at device_links_read_unlock()
Add the missing __releases(&device_links_srcu) annotation

Signed-off-by: Jules Irenge <jbi.octave@gmail.com>
Link: https://lore.kernel.org/r/20200214204741.94112-20-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 dca0b44 commit ab7789c
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 @@ -69,7 +69,7 @@ int device_links_read_lock(void)
return srcu_read_lock(&device_links_srcu);
}

void device_links_read_unlock(int idx)
void device_links_read_unlock(int idx) __releases(&device_links_srcu)
{
srcu_read_unlock(&device_links_srcu, idx);
}
Expand Down

0 comments on commit ab7789c

Please sign in to comment.