aboutsummaryrefslogtreecommitdiff
path: root/net/batman-adv/hash.c
diff options
context:
space:
mode:
authorSven Eckelmann <sven@narfation.org>2012-03-29 12:38:20 +0200
committerAntonio Quartulli <ordex@autistici.org>2012-06-18 18:00:57 +0200
commit5d52dad27a08d2c8851acb12b041088ec07881dd (patch)
treef5f05095d17bf618eed08fc79ee969b48937dc59 /net/batman-adv/hash.c
parentd2b6cc8e460494251442a877fcbc150faa175b4f (diff)
batman-adv: Initialize lockdep class keys for hashes
The hash for claim and backbone hash in the bridge loop avoidance code receive the same key because they are getting initialized by hash_new with the same key. Lockdep will create a backtrace when they are used recursively. This can be avoided by reinitializing the key directly after the hash_new. Signed-off-by: Sven Eckelmann <sven@narfation.org>
Diffstat (limited to 'net/batman-adv/hash.c')
-rw-r--r--net/batman-adv/hash.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/net/batman-adv/hash.c b/net/batman-adv/hash.c
index 117687bedf2..5b2eabe7c4e 100644
--- a/net/batman-adv/hash.c
+++ b/net/batman-adv/hash.c
@@ -69,3 +69,12 @@ free_hash:
kfree(hash);
return NULL;
}
+
+void batadv_hash_set_lock_class(struct hashtable_t *hash,
+ struct lock_class_key *key)
+{
+ uint32_t i;
+
+ for (i = 0; i < hash->size; i++)
+ lockdep_set_class(&hash->list_locks[i], key);
+}