From patchwork Thu Mar 19 15:46:24 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Pape X-Patchwork-Id: 4345 Return-Path: Received-SPF: None (no SPF record) identity=mailfrom; client-ip=62.157.123.121; helo=mail2.phoenixcontact.com; envelope-from=apape@phoenixcontact.com; receiver=b.a.t.m.a.n@lists.open-mesh.org Received: from mail2.phoenixcontact.com (mail2.phoenixcontact.com [62.157.123.121]) by open-mesh.org (Postfix) with ESMTPS id 6406D600AB7 for ; Thu, 19 Mar 2015 16:46:27 +0100 (CET) To: b.a.t.m.a.n@lists.open-mesh.org MIME-Version: 1.0 X-KeepSent: 5389A718:644E8229-C1257E0D:00566F9A; type=4; name=$KeepSent X-Mailer: Lotus Notes Release 8.5.3FP4 SHF39 May 13, 2013 From: Andreas Pape Message-ID: Date: Thu, 19 Mar 2015 16:46:24 +0100 X-MIMETrack: Serialize by Router on nemex02/spoke/SRV/DE/Phoenix Contact at 19.03.2015 16:46:24, Serialize complete at 19.03.2015 16:46:24 content-transfer-encoding: quoted-printable Subject: [B.A.T.M.A.N.] [PATCH] batman-adv: bugfix for kernel crash in batadv_tt_local_table_free X-BeenThere: b.a.t.m.a.n@lists.open-mesh.org X-Mailman-Version: 2.1.15 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: Thu, 19 Mar 2015 15:46:28 -0000 This missing check lead to a kernel crash when a hard_if is removed on a node forwarding untagged and tagged traffic (VLANID 0) to and from the mesh network. Signed-off-by: Andreas Pape --- translation-table.c | 6 ++++-- 1 files changed, 4 insertions(+), 2 deletions(-) } diff --git a/translation-table.c b/translation-table.c index b20812b..4d3ab8d 100644 --- a/translation-table.c +++ b/translation-table.c @@ -1143,8 +1143,10 @@ static void batadv_tt_local_table_free(struct batadv_priv *bat_priv) /* decrease the reference held for this vlan */ vlan = batadv_softif_vlan_get(bat_priv, tt_common_entry->vid); - batadv_softif_vlan_free_ref(vlan); - batadv_softif_vlan_free_ref(vlan); + if (vlan) { + batadv_softif_vlan_free_ref(vlan); + batadv_softif_vlan_free_ref(vlan); + } batadv_tt_local_entry_free_ref(tt_local);