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: 334981 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter1.kernel.org (8.14.4/8.14.3) with ESMTP id oAI3uHHb004617 for ; Thu, 18 Nov 2010 03:56:18 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751371Ab0KRD4O (ORCPT ); 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) Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.3 (demeter1.kernel.org [140.211.167.41]); Thu, 18 Nov 2010 03:56:18 +0000 (UTC) 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))