linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] bttv: fix mutex use before init
@ 2010-12-12 13:15 Dave Young
  2010-12-12 16:13 ` Torsten Kaiser
  0 siblings, 1 reply; 18+ messages in thread
From: Dave Young @ 2010-12-12 13:15 UTC (permalink / raw)
  To: linux-media, linux-kernel, Mauro Carvalho Chehab,
	Guennadi Liakhovetski, Chris Clayton

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;
 
 	/*

^ permalink raw reply	[flat|nested] 18+ messages in thread

end of thread, other threads:[~2010-12-17 20:11 UTC | newest]

Thread overview: 18+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-12-12 13:15 [PATCH] bttv: fix mutex use before init Dave Young
2010-12-12 16:13 ` 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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).