From patchwork Thu Nov 18 03:55:59 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dan Carpenter X-Patchwork-Id: 4951 Return-path: Envelope-to: mchehab@pedra Delivery-date: Thu, 18 Nov 2010 01:57:08 -0200 Received: from mchehab by pedra with local (Exim 4.72) (envelope-from ) id 1PIvcS-0001TM-CW for mchehab@pedra; Thu, 18 Nov 2010 01:57:08 -0200 Received: from casper.infradead.org [85.118.1.10] by pedra with IMAP (fetchmail-6.3.17) for (single-drop); Thu, 18 Nov 2010 01:57:08 -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 1PIvbw-0003kX-4c; Thu, 18 Nov 2010 03:56:36 +0000 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751371Ab0KRD4O (ORCPT + 1 other); Wed, 17 Nov 2010 22:56:14 -0500 Received: from mail-ww0-f44.google.com ([74.125.82.44]:46590 "EHLO mail-ww0-f44.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750698Ab0KRD4N (ORCPT ); Wed, 17 Nov 2010 22:56:13 -0500 Received: by wwa36 with SMTP id 36so2853300wwa.1 for ; Wed, 17 Nov 2010 19:56:12 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:date:from:to:cc:subject :message-id:mime-version:content-type:content-disposition:user-agent; bh=O0YjYMJQ8tsZBO7fE06TyqSev5VBpSHy+hUNUlbe4u0=; b=blXoTet5eCS6vsdAF7AGdb6xU6zuTLESt+0apReMwzHu0MWfsO0bij0Z9NiksvutW8 XCGwtWO7A9Y0ZEKU6/skIeMTTYBR3Ect94JjijFCTTgkDftJ2FbPh5ZgoaG2P2Is/w8M /AgO8+EUDG/qqHlU9JGK0Uj5uAHSoycoXITPU= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=date:from:to:cc:subject:message-id:mime-version:content-type :content-disposition:user-agent; b=WUL3qqjeLw+U0dhDrD2MTYqi8TE4Z5N2oG4apN+PKj/CCgMuEFupvvbKlQcFMwf8fT 1KpgA5d0gBvScQnsURyA2zJJMlXhGmc9L5QQWkHwvXDR1B6RaAiXj8Ff8Sw5Jg4yHdKx TNGNZd0krDVsMQGWXcuUtiPD6Aodjok7PCZn8= Received: by 10.216.141.79 with SMTP id f57mr40467wej.101.1290052571636; Wed, 17 Nov 2010 19:56:11 -0800 (PST) Received: from bicker (h2db1.n1.ips.mtn.co.ug [41.210.173.177]) by mx.google.com with ESMTPS id w41sm1519029weq.8.2010.11.17.19.56.08 (version=TLSv1/SSLv3 cipher=RC4-MD5); Wed, 17 Nov 2010 19:56:10 -0800 (PST) Date: Thu, 18 Nov 2010 06:55:59 +0300 From: Dan Carpenter To: Mauro Carvalho Chehab Cc: linux-media@vger.kernel.org, kernel-janitors@vger.kernel.org Subject: [patch] [media] bt8xx: missing unlock in bttv_overlay() Message-ID: <20101118035558.GK31724@bicker> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.20 (2009-06-14) Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org Sender: There is a missing unlock here. This was introduced as part of BKL removal in c37db91fd0d4 "V4L/DVB: bttv: fix driver lock and remove explicit calls to BKL" Signed-off-by: Dan Carpenter --- To unsubscribe from this list: send the line "unsubscribe linux-media" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/drivers/media/video/bt8xx/bttv-driver.c b/drivers/media/video/bt8xx/bttv-driver.c index 3da6e80..aca755c 100644 --- a/drivers/media/video/bt8xx/bttv-driver.c +++ b/drivers/media/video/bt8xx/bttv-driver.c @@ -2779,16 +2779,14 @@ static int bttv_overlay(struct file *file, void *f, unsigned int on) mutex_lock(&fh->cap.vb_lock); /* verify args */ if (unlikely(!btv->fbuf.base)) { - mutex_unlock(&fh->cap.vb_lock); - return -EINVAL; - } - if (unlikely(!fh->ov.setup_ok)) { + retval = -EINVAL; + } else if (unlikely(!fh->ov.setup_ok)) { dprintk("bttv%d: overlay: !setup_ok\n", btv->c.nr); retval = -EINVAL; } + mutex_unlock(&fh->cap.vb_lock); if (retval) return retval; - mutex_unlock(&fh->cap.vb_lock); } if (!check_alloc_btres_lock(btv, fh, RESOURCE_OVERLAY))