All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jiri Slaby <jslaby@suse.cz>
To: mchehab@redhat.com
Cc: linux-media@vger.kernel.org, linux-kernel@vger.kernel.org,
	jirislaby@gmail.com,
	Devin Heitmueller <dheitmueller@hauppauge.com>
Subject: [PATCH 1/4] V4L: cx231xx, fix lock imbalance
Date: Wed, 27 Oct 2010 13:47:37 +0200	[thread overview]
Message-ID: <1288180057-19656-1-git-send-email-jslaby@suse.cz> (raw)

Stanse found that there is mutex_lock in a fail path of
cx231xx_i2c_xfer instead of mutex_unlock (i.e. double lock + leaving a
function in locked state). So fix that.

Signed-off-by: Jiri Slaby <jslaby@suse.cz>
Cc: Mauro Carvalho Chehab <mchehab@redhat.com>
Cc: Devin Heitmueller <dheitmueller@hauppauge.com>
---
 drivers/media/video/cx231xx/cx231xx-i2c.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/media/video/cx231xx/cx231xx-i2c.c b/drivers/media/video/cx231xx/cx231xx-i2c.c
index cce74e5..8356706 100644
--- a/drivers/media/video/cx231xx/cx231xx-i2c.c
+++ b/drivers/media/video/cx231xx/cx231xx-i2c.c
@@ -372,7 +372,7 @@ static int cx231xx_i2c_xfer(struct i2c_adapter *i2c_adap,
 			rc = cx231xx_i2c_check_for_device(i2c_adap, &msgs[i]);
 			if (rc < 0) {
 				dprintk2(2, " no device\n");
-				mutex_lock(&dev->i2c_lock);
+				mutex_unlock(&dev->i2c_lock);
 				return rc;
 			}
 
-- 
1.7.3.1



             reply	other threads:[~2010-10-27 11:48 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-10-27 11:47 Jiri Slaby [this message]
2010-10-27 12:28 ` [PATCH 1/4] V4L: cx231xx, fix lock imbalance Devin Heitmueller

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=1288180057-19656-1-git-send-email-jslaby@suse.cz \
    --to=jslaby@suse.cz \
    --cc=dheitmueller@hauppauge.com \
    --cc=jirislaby@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-media@vger.kernel.org \
    --cc=mchehab@redhat.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.