9f43083535cd9bb3e3daa6e448506b2e16e8d1f5
[openwrt/svn-archive/archive.git] / net / batman-adv / patches / 0002-batman-adv_add_sanity_check_when_removing_global_tts.patch
1
2 After removing the batman-adv module, the hash may be already gone
3 when tt_global_del_orig() tries to clean the hash. This patch adds
4 a sanity check to avoid this.
5
6 Signed-off-by: Simon Wunderlich <siwu@hrz.tu-chemnitz.de>
7 ---
8 translation-table.c | 3 +++
9 1 files changed, 3 insertions(+), 0 deletions(-)
10
11 --- a/translation-table.c
12 +++ b/translation-table.c
13 @@ -712,6 +712,9 @@ void tt_global_del_orig(struct bat_priv *bat_priv,
14 struct hlist_head *head;
15 spinlock_t *list_lock; /* protects write access to the hash lists */
16
17 + if (!hash)
18 + return;
19 +
20 for (i = 0; i < hash->size; i++) {
21 head = &hash->table[i];
22 list_lock = &hash->list_locks[i];
23