From patchwork Tue Dec 14 10:36:58 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dan Carpenter X-Patchwork-Id: 409511 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 oBEAc6FJ003424 for ; Tue, 14 Dec 2010 10:38:06 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754687Ab0LNKhU (ORCPT ); Tue, 14 Dec 2010 05:37:20 -0500 Received: from mail-bw0-f45.google.com ([209.85.214.45]:52717 "EHLO mail-bw0-f45.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754312Ab0LNKhL (ORCPT ); Tue, 14 Dec 2010 05:37:11 -0500 Received: by bwz16 with SMTP id 16so585044bwz.4 for ; Tue, 14 Dec 2010 02:37:10 -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:references:mime-version:content-type:content-disposition :in-reply-to:user-agent; bh=f9SsMWsU74gdbL1pELmuXzcO0WglVDdQiYP0+kwGbEE=; b=KDkMXGFL1hxAt/e3TCtI+6ceuytDMoSq88D0dgKSrKMD3+ryFe+tI/e2CdGUcpEuS4 EGvkq6DLZcwKo/Nsxp5QsKhTb/uPXx3wK3VH3XCmeVG81rPLNII22rT9xdqEBxaJXXZu nH/rqmyhhJ9pIStZPles2TUyMSFl+5N9Rkouc= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=date:from:to:cc:subject:message-id:references:mime-version :content-type:content-disposition:in-reply-to:user-agent; b=YgaguaQXQS0mmQXBjAkIFWL6pj1CXdY6oZsBQwolnoyrWP5NqerOeuG5QwglR6ghFo 57pCzVcbvy7ZnetFai7tvusf8XCUoh0mbjBzrOZmyGZhaKg8w+WJHWUAInsoexreRvCZ PA9avWJhijRLJtjZz+AP0usiLQ+dgyhJsBec4= Received: by 10.204.100.70 with SMTP id x6mr4826021bkn.0.1292323030001; Tue, 14 Dec 2010 02:37:10 -0800 (PST) Received: from bicker ([41.138.6.25]) by mx.google.com with ESMTPS id j5sm602986bka.16.2010.12.14.02.37.06 (version=TLSv1/SSLv3 cipher=RC4-MD5); Tue, 14 Dec 2010 02:37:08 -0800 (PST) Date: Tue, 14 Dec 2010 13:36:58 +0300 From: Dan Carpenter To: Sergej Pupykin Cc: Mauro Carvalho Chehab , linux-media@vger.kernel.org Subject: Re: [patch v2] [media] bttv: take correct lock in bttv_open() Message-ID: <20101214103658.GL1620@bicker> References: <20101210033304.GX10623@bicker> <4D01D4BE.1080000@gmail.com> <20101212165812.GG10623@bicker> <4D054FE9.80000@gmail.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <4D054FE9.80000@gmail.com> 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]); Tue, 14 Dec 2010 10:38:06 +0000 (UTC) From error27@gmail.com Thu Nov 18 07:19:15 2010 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() MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset=utf-8 Status: RO 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 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))