diff options
author | Simon Wunderlich <simon.wunderlich@s2003.tu-chemnitz.de> | 2011-10-19 10:28:26 +0200 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2011-11-26 09:08:39 -0800 |
commit | 9bab392e4a2120bba4f6fbe8676a5baf16756926 (patch) | |
tree | d779131259e36c7e55f213454e4a9965eeb7c7c6 /net | |
parent | 7766f4ed0b29204dc9248dea3bc547a8c93d18cb (diff) | |
download | lwn-9bab392e4a2120bba4f6fbe8676a5baf16756926.tar.gz lwn-9bab392e4a2120bba4f6fbe8676a5baf16756926.zip |
batman-adv: add sanity check when removing global tts
commit 6e8014947d6469df1566e9e253805557c5c0e4e0 upstream.
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>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'net')
-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, 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]; |