From: Simon Wunderlich Date: Wed, 19 Oct 2011 08:28:26 +0000 (+0200) Subject: batman-adv: add sanity check when removing global tts X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=6e8014947d6469df1566e9e253805557c5c0e4e0;p=GitHub%2Fmt8127%2Fandroid_kernel_alcatel_ttab.git 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 Tested-by: Alexey Fisher Signed-off-by: Marek Lindner --- 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, 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];