fix range_table==NULL bug
authorDavid Schleef <ds@schleef.org>
Mon, 6 Mar 2000 03:13:17 +0000 (03:13 +0000)
committerDavid Schleef <ds@schleef.org>
Mon, 6 Mar 2000 03:13:17 +0000 (03:13 +0000)
comedi/comedi_fops.c

index b4859b605ce5b78553ebc9ec54f5328560371b40..e3a6c108f36ab5b342b86d74c77c3c2466cdb03a 100644 (file)
@@ -203,8 +203,12 @@ static int do_subdinfo_ioctl(comedi_device *dev,comedi_subdinfo *arg,void *file)
                us->timer_type          = TIMER_nanosec;
                us->len_chanlist        = s->len_chanlist;
                us->maxdata             = s->maxdata;
-               us->range_type          = (dev->minor<<24)|(i<<20)|(0<<16)|
-                       (s->range_table->length);
+               if(s->range_table){
+                       us->range_type  = (dev->minor<<24)|(i<<20)|(0<<16)|
+                                       (s->range_table->length);
+               }else{
+                       us->range_type  = 0; /* XXX */
+               }
                us->flags               = s->flags;
                
                if(s->busy)