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 --- translation-table.c | 3 +++ 1 files changed, 3 insertions(+), 0 deletions(-)
diff --git a/translation-table.c b/translation-table.c index c2af2b1..ffa846c 100644 --- a/translation-table.c +++ b/translation-table.c @@ -712,6 +712,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];