[PATCH] Fix bug in v4l core for 2.6.0-test3-bk

From: Greg KH
Date: Fri Aug 22 2003 - 12:18:41 EST


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);
}

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/