public inbox for linux-media@vger.kernel.org
 help / color / mirror / Atom feed
From: Dave Young <hidave.darkstar@gmail.com>
To: linux-media@vger.kernel.org, linux-kernel@vger.kernel.org,
	Mauro Carvalho Chehab <mchehab@infradead.org>,
	Guennadi Liakhovetski <g.liakhovetski@gmx.de>,
	Chris Clayton <chris2553@googlemail.com>
Subject: [PATCH] bttv: fix mutex use before init
Date: Sun, 12 Dec 2010 21:15:50 +0800	[thread overview]
Message-ID: <20101212131550.GA2608@darkstar> (raw)

oops happen in bttv_open while locking uninitialized mutex fh->cap.vb_lock
add mutex_init before usage

Signed-off-by: Dave Young <hidave.darkstar@gmail.com>
Tested-by: Chris Clayton <chris2553@googlemail.com>
---
 drivers/media/video/bt8xx/bttv-driver.c |    2 ++
 1 file changed, 2 insertions(+)

--- linux-2.6.orig/drivers/media/video/bt8xx/bttv-driver.c	2010-11-27 11:21:30.000000000 +0800
+++ linux-2.6/drivers/media/video/bt8xx/bttv-driver.c	2010-12-12 16:31:39.633333338 +0800
@@ -3291,6 +3291,8 @@ static int bttv_open(struct file *file)
 	fh = kmalloc(sizeof(*fh), GFP_KERNEL);
 	if (unlikely(!fh))
 		return -ENOMEM;
+
+	mutex_init(&fh->cap.vb_lock);
 	file->private_data = fh;
 
 	/*

             reply	other threads:[~2010-12-12 13:15 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-12-12 13:15 Dave Young [this message]
2010-12-12 16:13 ` [PATCH] bttv: fix mutex use before init Torsten Kaiser
2010-12-13 14:04   ` Dave Young
2010-12-13 19:06     ` Torsten Kaiser
2010-12-14  0:30   ` Brandon Philips
2010-12-14 12:05     ` Dave Young
2010-12-14 20:56     ` Torsten Kaiser
2010-12-14 21:13       ` Torsten Kaiser
2010-12-14 21:48         ` Brandon Philips
2010-12-14 21:43       ` Brandon Philips
2010-12-15  2:42         ` Dave Young
2010-12-15  6:47         ` Torsten Kaiser
2010-12-15 18:44     ` Chris Clayton
2010-12-15 21:45       ` Mauro Carvalho Chehab
2010-12-16 17:26         ` Chris Clayton
2010-12-17 14:05         ` Torsten Kaiser
2010-12-17 16:07         ` Brandon Philips
2010-12-17 20:11           ` Mauro Carvalho Chehab

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20101212131550.GA2608@darkstar \
    --to=hidave.darkstar@gmail.com \
    --cc=chris2553@googlemail.com \
    --cc=g.liakhovetski@gmx.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-media@vger.kernel.org \
    --cc=mchehab@infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox