Skip to contentSkip to conversation

batman-adv: add sanity check when removing global tts

PATCH In review Simon Wunderlich 4 participants 4 messages Oct 19, 2011 – Oct 24, 2011

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 batman-adv: add sanity check when removing global tts

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.

---
 translation-table.c |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)
translation-table.c +3 -0
index c2af2b1..ffa846c 100644
@@ -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];
Signature · 1 line
1.7.7
#1 lore raw

Hello,

Quoted 6 lines · Simon Wunderlich

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.

---

I got a feedback on IRC from fishor_ who said that the patch solved the kernel panic problem on module unload and on soft_iface deactivating.

Thank you for the patch Simon!

Signature · 4 lines
Antonio Quartulli

..each of us alone is worth nothing..
Ernesto "Che" Guevara
Tested-by
#2 lore raw
Quoted 7 lines · Antonio Quartulli

Hello,

Quoted 4 lines · Simon Wunderlich

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.

Quoted 8 lines
Quoted 2 lines

---

I got a feedback on IRC from fishor_ who said that the patch solved the kernel panic problem on module unload and on soft_iface deactivating.

Thank you for the patch Simon!

#3 lore raw
Quoted 11 lines · On Sunday, October 23, 2011 11:42:25 Alexey Fisher wrote:
Quoted 10 lines · Antonio Quartulli

Hello,

Quoted 6 lines · Simon Wunderlich

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.

---

Quoted 6 lines
Quoted 4 lines

I got a feedback on IRC from fishor_ who said that the patch solved the kernel panic problem on module unload and on soft_iface deactivating.

Thank you for the patch Simon!

Patch was applied in revision 4c7d468.

Thanks,
Marek