Hello. Once again, please Cc: me as I'm not in this list.

Still studying the drivers/usb directory using modules, I found that
the usage count of mousedev.o and keybdev.o never raises above 0.

If I got the point of the input mechanism, the usage count should be
increased whenever the "connect" handler gets called, and decresead at
"disconnect" time. Donald's description of usage counts matches my
point, so this time I propose a patch. This is completely untested, but
it "obviously right", with my usual bug rate of 1bug/line.

Note that this is different from my previous point, as earlier I was
referring to usbmouse.c and usbkbd.c.

This fix is not sponsored by Suse :)


--- ./mousedev.c.orig   Wed Apr  5 23:10:30 2000
+++ ./mousedev.c        Wed Apr  5 23:11:27 2000
@@ -419,6 +419,7 @@
        }
 #endif
 
+       MOD_INC_USE_COUNT;
        return 0;
 }
 
@@ -437,6 +438,7 @@
                kfree(mousedev);
        }
 #endif
+       MOD_DEC_USE_COUNT;
 }
        
 static struct input_handler mousedev_handler = {
--- ./keybdev.c.orig    Wed Apr  5 23:11:50 2000
+++ ./keybdev.c Wed Apr  5 23:12:24 2000
@@ -149,6 +149,7 @@
 
        printk("keybdev.c: Adding keyboard: input%d\n", dev->number);
 
+       MOD_INC_USE_COUNT;
        return 0;
 }
 
@@ -159,6 +160,7 @@
        input_close_device(handle);
 
        kfree(handle);
+       MOD_DEC_USE_COUNT;
 }
        
 static struct input_handler keybdev_handler = {



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to