summaryrefslogtreecommitdiffstats
path: root/net/batman-adv/main.c
diff options
context:
space:
mode:
authorSven Eckelmann <sven@narfation.org>2015-12-20 09:04:03 +0100
committerAntonio Quartulli <a@unstable.cc>2016-02-10 16:23:58 +0100
commitdded0692247c76f892adee3ba6878ff5f394e210 (patch)
treecd969de6f1411add186c42362cabd7869645f61a /net/batman-adv/main.c
parentbatman-adv: add seqno maximum age and protection start flag parameters (diff)
downloadlinux-dded0692247c76f892adee3ba6878ff5f394e210.tar.xz
linux-dded0692247c76f892adee3ba6878ff5f394e210.zip
batman-adv: Add lockdep assert for container_list_lock
The batadv_tvlv_container* functions state in their kernel-doc that they require tvlv.container_list_lock. Add an assert to automatically detect when this might have been ignored by the caller. Signed-off-by: Sven Eckelmann <sven@narfation.org> Signed-off-by: Marek Lindner <mareklindner@neomailbox.ch> Signed-off-by: Antonio Quartulli <a@unstable.cc>
Diffstat (limited to 'net/batman-adv/main.c')
-rw-r--r--net/batman-adv/main.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/net/batman-adv/main.c b/net/batman-adv/main.c
index 5f319fd6ecd7..a9b4f75db874 100644
--- a/net/batman-adv/main.c
+++ b/net/batman-adv/main.c
@@ -697,6 +697,8 @@ static struct batadv_tvlv_container
{
struct batadv_tvlv_container *tvlv_tmp, *tvlv = NULL;
+ lockdep_assert_held(&bat_priv->tvlv.container_list_lock);
+
hlist_for_each_entry(tvlv_tmp, &bat_priv->tvlv.container_list, list) {
if (tvlv_tmp->tvlv_hdr.type != type)
continue;
@@ -729,6 +731,8 @@ static u16 batadv_tvlv_container_list_size(struct batadv_priv *bat_priv)
struct batadv_tvlv_container *tvlv;
u16 tvlv_len = 0;
+ lockdep_assert_held(&bat_priv->tvlv.container_list_lock);
+
hlist_for_each_entry(tvlv, &bat_priv->tvlv.container_list, list) {
tvlv_len += sizeof(struct batadv_tvlv_hdr);
tvlv_len += ntohs(tvlv->tvlv_hdr.len);