public inbox for kernel-janitors@vger.kernel.org
 help / color / mirror / Atom feed
From: Dan Carpenter <dan.carpenter@oracle.com>
To: Linus Walleij <linus.walleij@linaro.org>
Cc: "Sjur Br�ndeland" <sjur.brandeland@stericsson.com>,
	linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org
Subject: [patch -next] xshm: calling unlock improperly in xshmchr_chrpoll()
Date: Thu, 08 Dec 2011 19:24:02 +0000	[thread overview]
Message-ID: <20111208192402.GA8810@elgon.mountain> (raw)

We got interrupted before we could take the lock here, and so we
shouldn't call unlock.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>

diff --git a/drivers/xshm/xshm_chr.c b/drivers/xshm/xshm_chr.c
index 8593367..4df1287 100644
--- a/drivers/xshm/xshm_chr.c
+++ b/drivers/xshm/xshm_chr.c
@@ -620,7 +620,7 @@ static unsigned int xshmchr_chrpoll(struct file *filp, poll_table *waittab)
 	if (mutex_lock_interruptible(&dev->mutex)) {
 		xdev_dbg(dev, "mutex_lock_interruptible got signalled\n");
 		mask |= POLLERR;
-		goto out;
+		goto out_unlocked;
 	}
 	xshmchr_get(dev);
 
@@ -644,6 +644,7 @@ static unsigned int xshmchr_chrpoll(struct file *filp, poll_table *waittab)
 
 out:
 	mutex_unlock(&dev->mutex);
+out_unlocked:
 	xdev_devl(dev, "poll return mask=0x%04x\n", mask);
 	xshmchr_put(dev);
 	return mask;

             reply	other threads:[~2011-12-08 19:24 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-12-08 19:24 Dan Carpenter [this message]
2011-12-09 12:43 ` [patch -next] xshm: calling unlock improperly in Sjur BRENDELAND

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=20111208192402.GA8810@elgon.mountain \
    --to=dan.carpenter@oracle.com \
    --cc=kernel-janitors@vger.kernel.org \
    --cc=linus.walleij@linaro.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=sjur.brandeland@stericsson.com \
    /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