From dec05074b1a322f5fbbe3f81bc438a75bfec3c34 Mon Sep 17 00:00:00 2001 From: Antonio Quartulli Date: Sat, 10 Nov 2012 11:00:32 +0100 Subject: batman-adv: Initialize lockdep class keys for hashes MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Different hashes have the same class key because they get initialised with the same one. For this reason lockdep can create false warning when they are used recursively. Re-initialise the key for each hash after the invocation to hash_new() to avoid this problem. Signed-off-by: Antonio Quartulli Tested-by: Linus Lüssing Signed-off-by: Marek Lindner --- net/batman-adv/originator.c | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'net/batman-adv/originator.c') diff --git a/net/batman-adv/originator.c b/net/batman-adv/originator.c index 8c32cf1c2dec..109081c49bbd 100644 --- a/net/batman-adv/originator.c +++ b/net/batman-adv/originator.c @@ -29,6 +29,9 @@ #include "soft-interface.h" #include "bridge_loop_avoidance.h" +/* hash class keys */ +static struct lock_class_key batadv_orig_hash_lock_class_key; + static void batadv_purge_orig(struct work_struct *work); static void batadv_start_purge_timer(struct batadv_priv *bat_priv) @@ -57,6 +60,9 @@ int batadv_originator_init(struct batadv_priv *bat_priv) if (!bat_priv->orig_hash) goto err; + batadv_hash_set_lock_class(bat_priv->orig_hash, + &batadv_orig_hash_lock_class_key); + batadv_start_purge_timer(bat_priv); return 0; -- cgit v1.2.1