<html><head><meta name="color-scheme" content="light dark"></head><body><pre style="word-wrap: break-word; white-space: pre-wrap;">From: Greg KH &lt;greg@kroah.com&gt;
To: Marcelo Tosatti &lt;marcelo@conectiva.com.br&gt;
Cc: linux-usb-devel@lists.sourceforge.net
Subject: [PATCH 1 of 5] USB ov511 driver bugfixes

Hi,

Here's a patch against 2.4.18-pre6 for the USB ov511 driver that fixes
an oops that happens with ioctl() is called on the driver's proc entry.
This patch was done by Mark McClelland.

thanks,

greg k-h


diff -Nru a/drivers/usb/ov511.c b/drivers/usb/ov511.c
--- a/drivers/usb/ov511.c	Sat Jan 26 19:56:09 2002
+++ b/drivers/usb/ov511.c	Sat Jan 26 19:56:09 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 "mmcclell@bigfoot.com"
 #define DRIVER_AUTHOR "Mark McClelland &lt;mmcclell@bigfoot.com&gt; &amp; Bret Wallach \
 	&amp; Orion Sky Lawlor &lt;olawlor@acm.org&gt; &amp; Kevin Moore &amp; 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/&lt;minor#&gt;/info */
@@ -673,8 +677,8 @@
 		unlock_kernel();
 		return;
 	}
-	ov511-&gt;proc_control-&gt;proc_fops-&gt;ioctl = ov511_control_ioctl;
 	ov511-&gt;proc_control-&gt;data = ov511;
+	ov511-&gt;proc_control-&gt;proc_fops = &amp;ov511_control_fops;
 	unlock_kernel();
 }
 
@@ -6893,13 +6897,13 @@
 		}
 	}
 
-	usb_driver_release_interface(&amp;ov511_driver,
-		&amp;ov511-&gt;dev-&gt;actconfig-&gt;interface[ov511-&gt;iface]);
-	ov511-&gt;dev = NULL;
-
 #if defined(CONFIG_PROC_FS) &amp;&amp; defined(CONFIG_VIDEO_PROC_FS)
         destroy_proc_ov511_cam(ov511);
 #endif
+
+	usb_driver_release_interface(&amp;ov511_driver,
+		&amp;ov511-&gt;dev-&gt;actconfig-&gt;interface[ov511-&gt;iface]);
+	ov511-&gt;dev = NULL;
 
 	/* Free the memory */
 	if (ov511 &amp;&amp; !ov511-&gt;user) {

</pre></body></html>