From: Sven Eckelmann <sven@narfation.org>
To: b.a.t.m.a.n@lists.open-mesh.org
Subject: [B.A.T.M.A.N.] [PATCH 2/2] batman-adv: Fix imbalanced locking in gw_node_update
Date: Fri, 1 Apr 2011 08:49:19 +0200 [thread overview]
Message-ID: <1301640559-4152-2-git-send-email-sven@narfation.org> (raw)
In-Reply-To: <1301640559-4152-1-git-send-email-sven@narfation.org>
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 <sven@narfation.org>
---
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);
}
--
1.7.4.1
next prev parent reply other threads:[~2011-04-01 6:49 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-04-01 6:49 [B.A.T.M.A.N.] [PATCH 1/2] batman-adv: Add missing static for softif_neigh_deselect Sven Eckelmann
2011-04-01 6:49 ` Sven Eckelmann [this message]
2011-04-01 7:00 ` [B.A.T.M.A.N.] [PATCHv2 2/2] batman-adv: Fix imbalanced locking in gw_node_update Sven Eckelmann
2011-04-01 19:59 ` [B.A.T.M.A.N.] [PATCH " Marek Lindner
2011-04-01 19:52 ` [B.A.T.M.A.N.] [PATCH 1/2] batman-adv: Add missing static for softif_neigh_deselect Marek Lindner
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1301640559-4152-2-git-send-email-sven@narfation.org \
--to=sven@narfation.org \
--cc=b.a.t.m.a.n@lists.open-mesh.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox