From: David Schleef Date: Thu, 13 Jul 2000 01:12:43 +0000 (+0000) Subject: __this_module fix X-Git-Tag: r0_7_46~7 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=c98a6e9eb467753122df46627c5acde98ddd9757;p=comedi.git __this_module fix --- diff --git a/comedi/drivers.c b/comedi/drivers.c index 94ea1e25..e4618ef2 100644 --- a/comedi/drivers.c +++ b/comedi/drivers.c @@ -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; }