Commit 9bab392e authored by Simon Wunderlich's avatar Simon Wunderlich Committed by Greg Kroah-Hartman

batman-adv: add sanity check when removing global tts

commit 6e801494 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: default avatarSimon Wunderlich <siwu@hrz.tu-chemnitz.de>
Tested-by: default avatarAlexey Fisher <bug-track@fisher-privat.net>
Signed-off-by: default avatarMarek Lindner <lindner_marek@yahoo.de>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent 7766f4ed
...@@ -698,6 +698,9 @@ void tt_global_del_orig(struct bat_priv *bat_priv, ...@@ -698,6 +698,9 @@ void tt_global_del_orig(struct bat_priv *bat_priv,
struct hlist_head *head; struct hlist_head *head;
spinlock_t *list_lock; /* protects write access to the hash lists */ spinlock_t *list_lock; /* protects write access to the hash lists */
if (!hash)
return;
for (i = 0; i < hash->size; i++) { for (i = 0; i < hash->size; i++) {
head = &hash->table[i]; head = &hash->table[i];
list_lock = &hash->list_locks[i]; list_lock = &hash->list_locks[i];
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment