Check async structure in comedi_unlock
authorDavid Schleef <ds@schleef.org>
Wed, 25 Apr 2001 09:24:43 +0000 (09:24 +0000)
committerDavid Schleef <ds@schleef.org>
Wed, 25 Apr 2001 09:24:43 +0000 (09:24 +0000)
comedi/kcomedilib/kcomedilib_main.c

index 6fef36b30368e64d3c9c8d729db05fdb668f9b9b..880f0b34b54c64d28ca5d29acdc2c9fb7b37b0c7 100644 (file)
@@ -802,9 +802,11 @@ int comedi_unlock(unsigned int minor,unsigned int subdev)
        if(s->lock==&rtcomedi_lock_semaphore){
                s->lock=NULL;
 
-               async->cb_mask=0;
-               async->cb_func=NULL;
-               async->cb_arg=NULL;
+               if(async){
+                       async->cb_mask=0;
+                       async->cb_func=NULL;
+                       async->cb_arg=NULL;
+               }
 
                __MOD_DEC_USE_COUNT(dev->driver->module);
        }