aboutsummaryrefslogtreecommitdiffstats
path: root/net/batman-adv/translation-table.c
diff options
context:
space:
mode:
authorAntonio Quartulli <ordex@autistici.org>2012-11-10 05:00:32 -0500
committerAntonio Quartulli <ordex@autistici.org>2013-01-12 05:58:21 -0500
commitdec05074b1a322f5fbbe3f81bc438a75bfec3c34 (patch)
tree407f9281efb3f42c83773b07c4aae48cb5041937 /net/batman-adv/translation-table.c
parent8425ec6aea20f8c8e1783d7390f5ea6ca01c58e1 (diff)
batman-adv: Initialize lockdep class keys for hashes
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 <ordex@autistici.org> Tested-by: Linus Lüssing <linus.luessing@web.de> Signed-off-by: Marek Lindner <lindner_marek@yahoo.de>
Diffstat (limited to 'net/batman-adv/translation-table.c')
-rw-r--r--net/batman-adv/translation-table.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/net/batman-adv/translation-table.c b/net/batman-adv/translation-table.c
index 5f442328f2e6..c6fd0b760d3e 100644
--- a/net/batman-adv/translation-table.c
+++ b/net/batman-adv/translation-table.c
@@ -29,6 +29,10 @@
29 29
30#include <linux/crc16.h> 30#include <linux/crc16.h>
31 31
32/* hash class keys */
33static struct lock_class_key batadv_tt_local_hash_lock_class_key;
34static struct lock_class_key batadv_tt_global_hash_lock_class_key;
35
32static void batadv_send_roam_adv(struct batadv_priv *bat_priv, uint8_t *client, 36static void batadv_send_roam_adv(struct batadv_priv *bat_priv, uint8_t *client,
33 struct batadv_orig_node *orig_node); 37 struct batadv_orig_node *orig_node);
34static void batadv_tt_purge(struct work_struct *work); 38static void batadv_tt_purge(struct work_struct *work);
@@ -235,6 +239,9 @@ static int batadv_tt_local_init(struct batadv_priv *bat_priv)
235 if (!bat_priv->tt.local_hash) 239 if (!bat_priv->tt.local_hash)
236 return -ENOMEM; 240 return -ENOMEM;
237 241
242 batadv_hash_set_lock_class(bat_priv->tt.local_hash,
243 &batadv_tt_local_hash_lock_class_key);
244
238 return 0; 245 return 0;
239} 246}
240 247
@@ -694,6 +701,9 @@ static int batadv_tt_global_init(struct batadv_priv *bat_priv)
694 if (!bat_priv->tt.global_hash) 701 if (!bat_priv->tt.global_hash)
695 return -ENOMEM; 702 return -ENOMEM;
696 703
704 batadv_hash_set_lock_class(bat_priv->tt.global_hash,
705 &batadv_tt_global_hash_lock_class_key);
706
697 return 0; 707 return 0;
698} 708}
699 709