This is a patch against 2.4.18-pre7 that fixes an oops in ov511. The 
code previously modified the kernel-global proc_file_operations 
structure, causing an oops whenever anything else does an ioctl() on a 
proc file. This is fairly dangerous since it causes shutdown to die 
during unmount.

Greg, please apply to 2.4.18-pre-latest (and to 2.5.x; it seems to apply 
cleanly to it too). Thanks.

-- 
Mark McClelland
[EMAIL PROTECTED]

diff -Nur linux-2.4.18-pre7-orig/drivers/usb/ov511.c linux/drivers/usb/ov511.c
--- linux-2.4.18-pre7-orig/drivers/usb/ov511.c  Sat Jan 26 05:16:43 2002
+++ linux/drivers/usb/ov511.c   Sat Jan 26 05:48:39 2002
@@ -57,7 +57,7 @@
 /*
  * Version Information
  */
-#define DRIVER_VERSION "v1.48 for Linux 2.4"
+#define DRIVER_VERSION "v1.48a for Linux 2.4"
 #define EMAIL "[EMAIL PROTECTED]"
 #define DRIVER_AUTHOR "Mark McClelland <[EMAIL PROTECTED]> & Bret Wallach \
        & Orion Sky Lawlor <[EMAIL PROTECTED]> & Kevin Moore & Charl P. Botha \
@@ -492,6 +492,10 @@
 static struct proc_dir_entry *ov511_proc_entry = NULL;
 extern struct proc_dir_entry *video_proc_entry;
 
+static struct file_operations ov511_control_fops = {
+       ioctl:          ov511_control_ioctl,
+};
+
 #define YES_NO(x) ((x) ? "yes" : "no")
 
 /* /proc/video/ov511/<minor#>/info */
@@ -673,8 +677,8 @@
                unlock_kernel();
                return;
        }
-       ov511->proc_control->proc_fops->ioctl = ov511_control_ioctl;
        ov511->proc_control->data = ov511;
+       ov511->proc_control->proc_fops = &ov511_control_fops;
        unlock_kernel();
 }
 
@@ -6893,14 +6897,14 @@
                }
        }
 
-       usb_driver_release_interface(&ov511_driver,
-               &ov511->dev->actconfig->interface[ov511->iface]);
-       ov511->dev = NULL;
-
 #if defined(CONFIG_PROC_FS) && defined(CONFIG_VIDEO_PROC_FS)
         destroy_proc_ov511_cam(ov511);
 #endif
 
+       usb_driver_release_interface(&ov511_driver,
+               &ov511->dev->actconfig->interface[ov511->iface]);
+       ov511->dev = NULL;
+
        /* Free the memory */
        if (ov511 && !ov511->user) {
                ov511_dealloc(ov511, 1);

Reply via email to