b.a.t.m.a.n.lists.open-mesh.org archive mirror
 help / color / mirror / Atom feed
* [B.A.T.M.A.N.] [PATCH 1/2] batman-adv: Add missing static for softif_neigh_deselect
@ 2011-04-01  6:49 Sven Eckelmann
  2011-04-01  6:49 ` [B.A.T.M.A.N.] [PATCH 2/2] batman-adv: Fix imbalanced locking in gw_node_update Sven Eckelmann
  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
  0 siblings, 2 replies; 5+ messages in thread
From: Sven Eckelmann @ 2011-04-01  6:49 UTC (permalink / raw)
  To: b.a.t.m.a.n

053e6e6c30c161c218eacf2eb2eb4c7ecc0f387c forgot to mark the only locally
used function softif_neigh_deselect as static.

Signed-off-by: Sven Eckelmann <sven@narfation.org>
---
 soft-interface.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/soft-interface.c b/soft-interface.c
index 599b668..58ce440 100644
--- a/soft-interface.c
+++ b/soft-interface.c
@@ -123,7 +123,7 @@ static void softif_neigh_select(struct bat_priv *bat_priv,
 	spin_unlock_bh(&bat_priv->softif_neigh_lock);
 }
 
-void softif_neigh_deselect(struct bat_priv *bat_priv)
+static void softif_neigh_deselect(struct bat_priv *bat_priv)
 {
 	softif_neigh_select(bat_priv, NULL);
 }
-- 
1.7.4.1


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

* [B.A.T.M.A.N.] [PATCH 2/2] batman-adv: Fix imbalanced locking in gw_node_update
  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
  2011-04-01  7:00   ` [B.A.T.M.A.N.] [PATCHv2 " 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
  1 sibling, 2 replies; 5+ messages in thread
From: Sven Eckelmann @ 2011-04-01  6:49 UTC (permalink / raw)
  To: b.a.t.m.a.n

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


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

* [B.A.T.M.A.N.] [PATCHv2 2/2] batman-adv: Fix imbalanced locking in gw_node_update
  2011-04-01  6:49 ` [B.A.T.M.A.N.] [PATCH 2/2] batman-adv: Fix imbalanced locking in gw_node_update Sven Eckelmann
@ 2011-04-01  7:00   ` Sven Eckelmann
  2011-04-01 19:59   ` [B.A.T.M.A.N.] [PATCH " Marek Lindner
  1 sibling, 0 replies; 5+ messages in thread
From: Sven Eckelmann @ 2011-04-01  7:00 UTC (permalink / raw)
  To: b.a.t.m.a.n

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>
---
Maybe the other patch is useful in the future... but changing the goto
to a return is less invasive and easier to understand

 gateway_client.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/gateway_client.c b/gateway_client.c
index 3d0050b..fff998a 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;
+		return;
 
 	rcu_read_lock();
 	hlist_for_each_entry_rcu(gw_node, node, &bat_priv->gw_list, list) {
-- 
1.7.4.1


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

* Re: [B.A.T.M.A.N.] [PATCH 1/2] batman-adv: Add missing static for softif_neigh_deselect
  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 ` [B.A.T.M.A.N.] [PATCH 2/2] batman-adv: Fix imbalanced locking in gw_node_update Sven Eckelmann
@ 2011-04-01 19:52 ` Marek Lindner
  1 sibling, 0 replies; 5+ messages in thread
From: Marek Lindner @ 2011-04-01 19:52 UTC (permalink / raw)
  To: The list for a Better Approach To Mobile Ad-hoc Networking

On Friday 01 April 2011 08:49:18 Sven Eckelmann wrote:
> 053e6e6c30c161c218eacf2eb2eb4c7ecc0f387c forgot to mark the only locally
> used function softif_neigh_deselect as static.

Applied in revision ga9125b6.

Thanks,
Marek

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

* Re: [B.A.T.M.A.N.] [PATCH 2/2] batman-adv: Fix imbalanced locking in gw_node_update
  2011-04-01  6:49 ` [B.A.T.M.A.N.] [PATCH 2/2] batman-adv: Fix imbalanced locking in gw_node_update Sven Eckelmann
  2011-04-01  7:00   ` [B.A.T.M.A.N.] [PATCHv2 " Sven Eckelmann
@ 2011-04-01 19:59   ` Marek Lindner
  1 sibling, 0 replies; 5+ messages in thread
From: Marek Lindner @ 2011-04-01 19:59 UTC (permalink / raw)
  To: The list for a Better Approach To Mobile Ad-hoc Networking

On Friday 01 April 2011 08:49:19 Sven Eckelmann wrote:
> 8ffdea813e32cee3c60be36fb9e6a5e077e51ea0 used rcu_read_unlock without
> using rcu_read_lock when gw_get_selected_gw_node didn't return a valid
> gw_node.

Applied a slightly modified variant in revision g76eab02.

Thanks,
Marek

PS: I prefer the goto patch over the return statement. :-)

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

end of thread, other threads:[~2011-04-01 19:59 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
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 ` [B.A.T.M.A.N.] [PATCH 2/2] batman-adv: Fix imbalanced locking in gw_node_update Sven Eckelmann
2011-04-01  7:00   ` [B.A.T.M.A.N.] [PATCHv2 " 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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).