... and check that ai_mite_chan is not NULL after we have spinlock.
authorFrank Mori Hess <fmhess@speakeasy.net>
Fri, 21 Mar 2008 18:48:51 +0000 (18:48 +0000)
committerFrank Mori Hess <fmhess@speakeasy.net>
Fri, 21 Mar 2008 18:48:51 +0000 (18:48 +0000)
comedi/drivers/ni_mio_common.c

index bd69df4768510e57180906f4b6eac2d88a4acf8f..9718703ee7a99323b350f565d837d834a4f1acfb 100644 (file)
@@ -1554,6 +1554,12 @@ static int ni_ai_setup_MITE_dma(comedi_device * dev)
 
 
        comedi_spin_lock_irqsave(&devpriv->mite_channel_lock, flags);
+       if(devpriv->ai_mite_chan == NULL)
+       {
+               comedi_spin_unlock_irqrestore(&devpriv->mite_channel_lock, flags);
+               return -EIO;
+       }
+
        switch (boardtype.reg_type) {
        case ni_reg_611x:
        case ni_reg_6143: