__this_module fix
authorDavid Schleef <ds@schleef.org>
Thu, 13 Jul 2000 01:12:43 +0000 (01:12 +0000)
committerDavid Schleef <ds@schleef.org>
Thu, 13 Jul 2000 01:12:43 +0000 (01:12 +0000)
comedi/drivers.c

index 94ea1e255d7af75f2a6dd7401e3546a6d6983877..e4618ef2b4df6a6e81d5280378a2d8cbc98cf085 100644 (file)
@@ -60,7 +60,8 @@ int comedi_device_detach(comedi_device *dev)
                return 0;
 
        /* this is not correct for the kmod case */
-       __MOD_DEC_USE_COUNT(dev->driver->module);
+       if(dev->driver->module)
+               __MOD_DEC_USE_COUNT(dev->driver->module);
 
        dev->attached=0;
 
@@ -122,7 +123,8 @@ attached:
        dev->attached=1;
        dev->driver=driv;
 
-       __MOD_INC_USE_COUNT(driv->module);
+       if(dev->driver->module)
+               __MOD_INC_USE_COUNT(driv->module);
 
        return 0;
 }