From patchwork Wed Oct 27 11:47:37 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jiri Slaby X-Patchwork-Id: 4726 Return-path: Envelope-to: mchehab@pedra Delivery-date: Wed, 27 Oct 2010 09:48:45 -0200 Received: from mchehab by pedra with local (Exim 4.72) (envelope-from ) id 1PB4Un-00022T-21 for mchehab@pedra; Wed, 27 Oct 2010 09:48:45 -0200 Received: from casper.infradead.org [85.118.1.10] by pedra with IMAP (fetchmail-6.3.17) for (single-drop); Wed, 27 Oct 2010 09:48:45 -0200 (BRST) Received: from vger.kernel.org ([209.132.180.67]) by casper.infradead.org with esmtp (Exim 4.72 #1 (Red Hat Linux)) id 1PB4U8-0002VL-EZ; Wed, 27 Oct 2010 11:48:04 +0000 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754009Ab0J0LsC (ORCPT + 1 other); Wed, 27 Oct 2010 07:48:02 -0400 Received: from mail.pripojeni.net ([217.66.174.14]:45681 "EHLO smtp.pripojeni.net" rhost-flags-OK-FAIL-OK-OK) by vger.kernel.org with ESMTP id S1751737Ab0J0LsB (ORCPT ); Wed, 27 Oct 2010 07:48:01 -0400 Received: from localhost.localdomain ([217.66.174.142]) by smtp.pripojeni.net (Kerio Connect 7.1.1); Wed, 27 Oct 2010 13:47:38 +0200 From: Jiri Slaby To: mchehab@redhat.com Cc: linux-media@vger.kernel.org, linux-kernel@vger.kernel.org, jirislaby@gmail.com, Devin Heitmueller Subject: [PATCH 1/4] V4L: cx231xx, fix lock imbalance Date: Wed, 27 Oct 2010 13:47:37 +0200 Message-Id: <1288180057-19656-1-git-send-email-jslaby@suse.cz> X-Mailer: git-send-email 1.7.3.1 Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org Sender: 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 Cc: Mauro Carvalho Chehab Cc: Devin Heitmueller --- 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; }