From patchwork Sun Dec 12 16:58:12 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dan Carpenter X-Patchwork-Id: 401132 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 oBCGwPgp008302 for ; Sun, 12 Dec 2010 16:58:25 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751861Ab0LLQ6W (ORCPT ); Sun, 12 Dec 2010 11:58:22 -0500 Received: from mail-wy0-f174.google.com ([74.125.82.174]:56958 "EHLO mail-wy0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750957Ab0LLQ6W (ORCPT ); Sun, 12 Dec 2010 11:58:22 -0500 Received: by wyb28 with SMTP id 28so5130991wyb.19 for ; Sun, 12 Dec 2010 08:58:21 -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=z6Uhe7m0eSG8Tv3Bw/+0y2iLt0WDKvgULxtUTYGAlgA=; b=u0jDvhvHmZiPi1vzOt2nGzmQasM/m1d62xTsT0J83StcTRA3BuSt23o1XbcfBIv16t v650zK9efiKMYVZFThxXE4ND6zp6upJgRajyVRMMYh0JWd9cgdQFvL8U8nS28KKaZnwg KrIWo5FW+xOmnt+LwFpYL8oqoHzV61S1aoh3o= 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=sGA/qseG9c7hjWU9r+z/VShZSLroM6jhwDvBsxWE3QVrR7uan0c0up0ezsgSJ9oFIU hX5uIncCZXUaiMyPA+8NbH3bJSzx5jgQyg5GtAQMAFZmAm1VMvoGRlPkLVNubnQcI/6X nCWySVPTb8ydP3l4j+gjt/JENa+18OosCpDM0= Received: by 10.216.188.67 with SMTP id z45mr3608500wem.7.1292173099214; Sun, 12 Dec 2010 08:58:19 -0800 (PST) Received: from bicker (h2dd3.n1.ips.mtn.co.ug [41.210.173.211]) by mx.google.com with ESMTPS id t5sm148939wes.33.2010.12.12.08.58.14 (version=TLSv1/SSLv3 cipher=RC4-MD5); Sun, 12 Dec 2010 08:58:18 -0800 (PST) Date: Sun, 12 Dec 2010 19:58:12 +0300 From: Dan Carpenter To: Sergej Pupykin Cc: Mauro Carvalho Chehab , linux-media@vger.kernel.org Subject: [patch v2] [media] bttv: take correct lock in bttv_open() Message-ID: <20101212165812.GG10623@bicker> References: <20101210033304.GX10623@bicker> <4D01D4BE.1080000@gmail.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <4D01D4BE.1080000@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]); Sun, 12 Dec 2010 16:58:25 +0000 (UTC) diff --git a/drivers/media/video/bt8xx/bttv-driver.c b/drivers/media/video/bt8xx/bttv-driver.c index a529619..6c8f4b0 100644 --- a/drivers/media/video/bt8xx/bttv-driver.c +++ b/drivers/media/video/bt8xx/bttv-driver.c @@ -3302,9 +3302,9 @@ static int bttv_open(struct file *file) * Let's first copy btv->init at fh, holding cap.vb_lock, and then work * with the rest of init, holding btv->lock. */ - mutex_lock(&fh->cap.vb_lock); + mutex_lock(&btv->init.cap.vb_lock); *fh = btv->init; - mutex_unlock(&fh->cap.vb_lock); + mutex_unlock(&btv->init.cap.vb_lock); fh->type = type; fh->ov.setup_ok = 0;