diff options
author | Simon Wunderlich <simon.wunderlich@s2003.tu-chemnitz.de> | 2011-10-19 04:28:26 -0400 |
---|---|---|
committer | Marek Lindner <lindner_marek@yahoo.de> | 2011-10-25 08:23:04 -0400 |
commit | 6e8014947d6469df1566e9e253805557c5c0e4e0 (patch) | |
tree | 4088b0603c38b7244904aa7022f9833fba38ce9e /net/batman-adv | |
parent | 531027fcddbcf81c9937dd04f08a7e8f11fd47d2 (diff) |
batman-adv: add sanity check when removing global tts
After removing the batman-adv module, the hash may be already gone
when tt_global_del_orig() tries to clean the hash. This patch adds
a sanity check to avoid this.
Signed-off-by: Simon Wunderlich <siwu@hrz.tu-chemnitz.de>
Tested-by: Alexey Fisher <bug-track@fisher-privat.net>
Signed-off-by: Marek Lindner <lindner_marek@yahoo.de>
Diffstat (limited to 'net/batman-adv')
-rw-r--r-- | net/batman-adv/translation-table.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/net/batman-adv/translation-table.c b/net/batman-adv/translation-table.c index ca537ed2dd0a..d58fd8b9c818 100644 --- a/net/batman-adv/translation-table.c +++ b/net/batman-adv/translation-table.c | |||
@@ -698,6 +698,9 @@ void tt_global_del_orig(struct bat_priv *bat_priv, | |||
698 | struct hlist_head *head; | 698 | struct hlist_head *head; |
699 | spinlock_t *list_lock; /* protects write access to the hash lists */ | 699 | spinlock_t *list_lock; /* protects write access to the hash lists */ |
700 | 700 | ||
701 | if (!hash) | ||
702 | return; | ||
703 | |||
701 | for (i = 0; i < hash->size; i++) { | 704 | for (i = 0; i < hash->size; i++) { |
702 | head = &hash->table[i]; | 705 | head = &hash->table[i]; |
703 | list_lock = &hash->list_locks[i]; | 706 | list_lock = &hash->list_locks[i]; |