public inbox for b.a.t.m.a.n@lists.open-mesh.org
 help / color / mirror / Atom feed
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] batman-adv: Fix rcu_lock imbalance in softif_neigh_get
Date: Wed,  4 May 2011 21:14:58 +0200	[thread overview]
Message-ID: <1304536498-22584-1-git-send-email-sven@narfation.org> (raw)

Fix extra rcu_read_unlock after an failed softif_neigh_vid_get in
softif_neigh_get introduced by 0281a6aab718965d7c0ef45c4ba22e305f6aefe7

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

diff --git a/soft-interface.c b/soft-interface.c
index 1827734..8023c4e 100644
--- a/soft-interface.c
+++ b/soft-interface.c
@@ -175,12 +175,12 @@ static struct softif_neigh *softif_neigh_get(struct bat_priv *bat_priv,
 			continue;
 
 		softif_neigh->last_seen = jiffies;
-		goto out;
+		goto unlock;
 	}
 
 	softif_neigh = kzalloc(sizeof(struct softif_neigh), GFP_ATOMIC);
 	if (!softif_neigh)
-		goto out;
+		goto unlock;
 
 	memcpy(softif_neigh->addr, addr, ETH_ALEN);
 	softif_neigh->last_seen = jiffies;
@@ -193,8 +193,9 @@ static struct softif_neigh *softif_neigh_get(struct bat_priv *bat_priv,
 			   &softif_neigh_vid->softif_neigh_list);
 	spin_unlock_bh(&bat_priv->softif_neigh_lock);
 
-out:
+unlock:
 	rcu_read_unlock();
+out:
 	if (softif_neigh_vid)
 		softif_neigh_vid_free_ref(softif_neigh_vid);
 	return softif_neigh;
-- 
1.7.4.4


             reply	other threads:[~2011-05-04 19:14 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-05-04 19:14 Sven Eckelmann [this message]
2011-05-04 22:53 ` [B.A.T.M.A.N.] [PATCH] batman-adv: Fix rcu_lock imbalance in softif_neigh_get 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=1304536498-22584-1-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