public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] Fix bug in v4l core for 2.6.0-test3-bk
@ 2003-08-22 17:13 Greg KH
  0 siblings, 0 replies; only message in thread
From: Greg KH @ 2003-08-22 17:13 UTC (permalink / raw)
  To: kraxel; +Cc: linux-kernel

Hi,

When working on converting the usb v4l drivers to the new v4l class
changes, I ran into this nasty bug.  Seems that the core was using a
structure after it had been freed.  The patch below fixes it.

If you don't mind, I'll include it with some USB patches in a send to
Linus, as my USB fixes will not work without it.

thanks,

greg k-h


# V4L: fix use after free bug in v4l core.

diff -Nru a/drivers/media/video/videodev.c b/drivers/media/video/videodev.c
--- a/drivers/media/video/videodev.c	Fri Aug 22 10:09:38 2003
+++ b/drivers/media/video/videodev.c	Fri Aug 22 10:09:38 2003
@@ -349,9 +349,9 @@
 	if(video_device[vfd->minor]!=vfd)
 		panic("videodev: bad unregister");
 
-	class_device_unregister(&vfd->class_dev);
 	devfs_remove(vfd->devfs_name);
 	video_device[vfd->minor]=NULL;
+	class_device_unregister(&vfd->class_dev);
 	up(&videodev_lock);
 }
 

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2003-08-22 17:13 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-08-22 17:13 [PATCH] Fix bug in v4l core for 2.6.0-test3-bk Greg KH

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox