From patchwork Sat Oct 29 08:06:45 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marek Lindner X-Patchwork-Id: 1323 Return-Path: Received: from nm20-vm0.bullet.mail.ukl.yahoo.com (nm20-vm0.bullet.mail.ukl.yahoo.com [217.146.183.115]) by open-mesh.org (Postfix) with SMTP id 7177E600848 for ; Sat, 29 Oct 2011 10:07:27 +0200 (CEST) Authentication-Results: open-mesh.org; dkim=pass (1024-bit key) header.i=@yahoo.de; dkim-adsp=none Received: from [217.146.183.217] by nm20.bullet.mail.ukl.yahoo.com with NNFMP; 29 Oct 2011 08:07:27 -0000 Received: from [77.238.184.77] by tm10.bullet.mail.ukl.yahoo.com with NNFMP; 29 Oct 2011 08:07:27 -0000 Received: from [127.0.0.1] by smtp146.mail.ukl.yahoo.com with NNFMP; 29 Oct 2011 08:07:27 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.de; s=s1024; t=1319875647; bh=LReEkaZqVCTNl0YKqBPiDbUs0WOw6bBd1WvKeO1flbY=; h=X-Yahoo-Newman-Id:X-Yahoo-Newman-Property:X-YMail-OSG:X-Yahoo-SMTP:Received:From:To:Cc:Subject:Date:Message-Id:X-Mailer:In-Reply-To:References; b=T83Wzu0EmCIcev7mV4JkzLolSe+1HuRUM9IsrDcc1JnQfOtJ2WZvKKZ1+QSvb2smOZrkfh5lxTcAy7M2fhh/Gkf1GEEHnJRLx7r2hNEX3+sHurjbSLa/uXME+J+fttsfWDpnQ2Av4Z1JgxG/mdm98/ZLP+WkGVLgGy+YIKIS7WI= X-Yahoo-Newman-Id: 74851.82759.bm@smtp146.mail.ukl.yahoo.com X-Yahoo-Newman-Property: ymail-3 X-YMail-OSG: YPJSUMgVM1mcrg6sf3VZW_YYrTlDigmqU6ykCqwfI1cT6x8 bDT6rO4JXd8MSXvPee8lYkxA7KQC6oDNzhGnELOvcFMFeTR.UVQSyaf5uQsE tcXaSsg3q3LQw_Bg90yHbIfuAV8olFFA2B4klTQ2_DPCvk_aPh2R43DEp.vq mVXZcB3eTdpvgz26g1WAlHKbjkCUy.gY15y.RoqnLgiFySC9Nh1QAxcJFMVL GsxorXz8liypSGoKIx5nYV7aqNBqV.0iiXTuSPx44bdLmQ.A8RZc.vAePP1n z6s3VIUjlhbSsDrVsitAc39.xhsTGaINvjJWvVbjHV474HNJV3hKo_GSBSFV 46fNcJYeJkXurNCFPHp70Zx2SRDiIqRc_3CH7m7VAxzAUpPhlL_Lvgq8v X-Yahoo-SMTP: tW.h3tiswBBMXO2coYcbPigGD5Lt6zY_.Zc- Received: from localhost (lindner_marek@78.46.248.235 with plain) by smtp146.mail.ukl.yahoo.com with SMTP; 29 Oct 2011 08:07:25 +0000 GMT From: Marek Lindner To: davem@davemloft.net Date: Sat, 29 Oct 2011 10:06:45 +0200 Message-Id: <1319875606-7794-3-git-send-email-lindner_marek@yahoo.de> X-Mailer: git-send-email 1.7.5.4 In-Reply-To: <1319875606-7794-1-git-send-email-lindner_marek@yahoo.de> References: <1319875606-7794-1-git-send-email-lindner_marek@yahoo.de> Cc: netdev@vger.kernel.org, b.a.t.m.a.n@lists.open-mesh.org, Simon Wunderlich , Marek Lindner , stable@kernel.org Subject: [B.A.T.M.A.N.] [PATCH 2/3] batman-adv: add sanity check when removing global tts X-BeenThere: b.a.t.m.a.n@lists.open-mesh.org X-Mailman-Version: 2.1.13 Precedence: list Reply-To: The list for a Better Approach To Mobile Ad-hoc Networking List-Id: The list for a Better Approach To Mobile Ad-hoc Networking List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 29 Oct 2011 08:07:27 -0000 From: 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. Signed-off-by: Simon Wunderlich Tested-by: Alexey Fisher Signed-off-by: Marek Lindner --- net/batman-adv/translation-table.c | 3 +++ 1 files changed, 3 insertions(+), 0 deletions(-) diff --git a/net/batman-adv/translation-table.c b/net/batman-adv/translation-table.c index abf05cb..c7aafc7 100644 --- a/net/batman-adv/translation-table.c +++ b/net/batman-adv/translation-table.c @@ -722,6 +722,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];