From patchwork Fri Apr 1 06:49:19 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sven Eckelmann X-Patchwork-Id: 910 Return-Path: Received: from v3-1039.vlinux.de (narfation.org [79.140.41.39]) by open-mesh.org (Postfix) with ESMTPS id CD965154410 for ; Fri, 1 Apr 2011 08:49:29 +0200 (CEST) Authentication-Results: open-mesh.org; dkim=pass (1024-bit key) header.i=@narfation.org; dkim-adsp=pass Received: from sven-desktop.home.narfation.org (camo157-29.hrz.tu-chemnitz.de [134.109.157.29]) by v3-1039.vlinux.de (Postfix) with ESMTPSA id A1296940D2; Fri, 1 Apr 2011 08:49:27 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=narfation.org; s=mail; t=1301640567; bh=ova+sOOw2/Z8RwPrLzZ8wYgpAEMEyuNViZ9LAHfSgyM=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References; b=Rc0JpTB2ssmz1d65WmSsYl7agYcItCu3pyVwfRcvDbKWrpnhImrQXGdsQ/QkBGVyi 7sN6qsAzrdeLB938gtZCm3zUEuzMMfcARN0zqPGVv97WVFPiWmXZOszemnvMdoV420 gGioq0oKIKaCg+OhBHhDMelESNLemUjsUBqYOprw= From: Sven Eckelmann To: b.a.t.m.a.n@lists.open-mesh.org Date: Fri, 1 Apr 2011 08:49:19 +0200 Message-Id: <1301640559-4152-2-git-send-email-sven@narfation.org> X-Mailer: git-send-email 1.7.4.1 In-Reply-To: <1301640559-4152-1-git-send-email-sven@narfation.org> References: <1301640559-4152-1-git-send-email-sven@narfation.org> Subject: [B.A.T.M.A.N.] [PATCH 2/2] batman-adv: Fix imbalanced locking in gw_node_update 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: Fri, 01 Apr 2011 06:49:30 -0000 8ffdea813e32cee3c60be36fb9e6a5e077e51ea0 used rcu_read_unlock without using rcu_read_lock when gw_get_selected_gw_node didn't return a valid gw_node. Signed-off-by: Sven Eckelmann --- gateway_client.c | 3 ++- 1 files changed, 2 insertions(+), 1 deletions(-) diff --git a/gateway_client.c b/gateway_client.c index 3d0050b..a5757da 100644 --- a/gateway_client.c +++ b/gateway_client.c @@ -312,7 +312,7 @@ void gw_node_update(struct bat_priv *bat_priv, curr_gw = gw_get_selected_gw_node(bat_priv); if (!curr_gw) - goto out; + goto freeref; rcu_read_lock(); hlist_for_each_entry_rcu(gw_node, node, &bat_priv->gw_list, list) { @@ -350,6 +350,7 @@ deselect: gw_deselect(bat_priv); out: rcu_read_unlock(); +freeref: if (curr_gw) gw_node_free_ref(curr_gw); }