public inbox for b.a.t.m.a.n@lists.open-mesh.org
 help / color / mirror / Atom feed
* [B.A.T.M.A.N.] [PATCH] batman-adv: add sanity check when removing global tts
@ 2011-10-19  8:28 Simon Wunderlich
  2011-10-23  9:38 ` Antonio Quartulli
  0 siblings, 1 reply; 4+ messages in thread
From: Simon Wunderlich @ 2011-10-19  8:28 UTC (permalink / raw)
  To: b.a.t.m.a.n

[-- Attachment #1: Type: text/plain, Size: 784 bytes --]

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];
-- 
1.7.7



[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 198 bytes --]

^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2011-10-24 12:07 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-10-19  8:28 [B.A.T.M.A.N.] [PATCH] batman-adv: add sanity check when removing global tts Simon Wunderlich
2011-10-23  9:38 ` Antonio Quartulli
2011-10-23  9:42   ` Alexey Fisher
2011-10-24 12:07     ` Marek Lindner

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox