Am Sonntag, 9. Dezember 2001 23:35 schrieb Jeroen Vreeken:
> Hi,
>
> I see no problem with this patch,
> Johannes can you apply this patch?

It fails however, to do proper reference counting
during probe() and disconnect(). A patch to do that is included.

        Regards
                Oliver

--- drivers/usb/se401.c.alt     Mon Sep 17 11:05:32 2001
+++ drivers/usb/se401.c Mon Dec 10 09:29:56 2001
@@ -1533,11 +1533,14 @@
         if (interface->bInterfaceSubClass != 0x00)
                 return NULL;
 
+       MOD_INC_USE_COUNT;
+
         /* We found one */
         info("SE401 camera found: %s", camera_name);
 
         if ((se401 = kmalloc(sizeof(*se401), GFP_KERNEL)) == NULL) {
                 err("couldn't kmalloc se401 struct");
+               MOD_DEC_USE_COUNT;
                 return NULL;
         }
 
@@ -1551,6 +1554,7 @@
 
         if (se401_init(se401)) {
                kfree(se401);
+               MOD_DEC_USE_COUNT;
                return NULL;
        }
 
@@ -1563,9 +1567,11 @@
        if (video_register_device(&se401->vdev, VFL_TYPE_GRABBER, video_nr) == -1) {
                kfree(se401);
                err("video_register_device failed");
+               MOD_DEC_USE_COUNT;
                return NULL;
        }
        info("registered new video device: video%d", se401->vdev.minor);
+       MOD_DEC_USE_COUNT;
 
         return se401;
 }
@@ -1573,6 +1579,7 @@
 static void se401_disconnect(struct usb_device *dev, void *ptr)
 {
        struct usb_se401 *se401 = (struct usb_se401 *) ptr;
+       MOD_INC_USE_COUNT;
 
        lock_kernel();
        /* We don't want people trying to open up the device */
@@ -1582,6 +1589,7 @@
        } else {
                se401->removed = 1;
        }
+       MOD_DEC_USE_COUNT;
        unlock_kernel();
 }
 

_______________________________________________
[EMAIL PROTECTED]
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel

Reply via email to