Skip to content

Commit

Permalink
batman-adv: add sanity check when removing global tts
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Simon Wunderlich authored and Marek Lindner committed Oct 25, 2011
1 parent 531027f commit 6e80149
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions net/batman-adv/translation-table.c
Original file line number Diff line number Diff line change
Expand Up @@ -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];
Expand Down

0 comments on commit 6e80149

Please sign in to comment.