The following commit has been merged in the maint branch: commit 24ccf55154d49d78660a28f383664e938f9e97f2 Author: Simon Wunderlich simon.wunderlich@s2003.tu-chemnitz.de Date: Wed Oct 19 10:28:26 2011 +0200
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
diff --git a/translation-table.c b/translation-table.c index ca537ed..d58fd8b 100644 --- a/translation-table.c +++ b/translation-table.c @@ -698,6 +698,9 @@ void tt_global_del_orig(struct bat_priv *bat_priv, struct hlist_head *head; spinlock_t *list_lock; /* protects write access to the hash lists */
+ if (!hash) + return; + for (i = 0; i < hash->size; i++) { head = &hash->table[i]; list_lock = &hash->list_locks[i];