mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Jiri Slaby <jirislaby@gmail.com>
To: axboe@kernel.dk
Cc: linux-kernel@vger.kernel.org, Jiri Slaby <jirislaby@gmail.com>,
	Eduard - Gabriel Munteanu <eduard.munteanu@linux360.ro>,
	Jens Axboe <axboe@suse.de>
Subject: [PATCH 1/1] relay: fix lock imbalance in relay_late_setup_files
Date: Sat, 17 Jan 2009 12:04:36 +0100	[thread overview]
Message-ID: <1232190276-21200-1-git-send-email-jirislaby@gmail.com> (raw)

One fail path in relay_late_setup_files() omits
mutex_unlock(&relay_channels_mutex);
Add it.

Signed-off-by: Jiri Slaby <jirislaby@gmail.com>
Cc: Eduard - Gabriel Munteanu <eduard.munteanu@linux360.ro>
Cc: Jens Axboe <axboe@suse.de>
---
 kernel/relay.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/kernel/relay.c b/kernel/relay.c
index 8ca1587..738bc85 100644
--- a/kernel/relay.c
+++ b/kernel/relay.c
@@ -714,8 +714,10 @@ int relay_late_setup_files(struct rchan *chan,
 
 	mutex_lock(&relay_channels_mutex);
 	/* Is chan already set up? */
-	if (unlikely(chan->has_base_filename))
+	if (unlikely(chan->has_base_filename)) {
+		mutex_unlock(&relay_channels_mutex);
 		return -EEXIST;
+	}
 	chan->has_base_filename = 1;
 	chan->parent = parent;
 	curr_cpu = get_cpu();
-- 
1.6.1
caught by stanse

             reply	other threads:[~2009-01-17 11:05 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-01-17 11:04 Jiri Slaby [this message]
2009-01-17 19:41 ` Eduard - Gabriel Munteanu
2009-01-19 10:15 ` Jens Axboe

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=1232190276-21200-1-git-send-email-jirislaby@gmail.com \
    --to=jirislaby@gmail.com \
    --cc=axboe@kernel.dk \
    --cc=axboe@suse.de \
    --cc=eduard.munteanu@linux360.ro \
    --cc=linux-kernel@vger.kernel.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

Powered by JetHome