From: Frank Mori Hess Date: Fri, 21 Mar 2008 18:48:51 +0000 (+0000) Subject: ... and check that ai_mite_chan is not NULL after we have spinlock. X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=f66a4ad74a1b5c41f44b2531545cdcd419c1cdc8;p=comedi.git ... and check that ai_mite_chan is not NULL after we have spinlock. --- diff --git a/comedi/drivers/ni_mio_common.c b/comedi/drivers/ni_mio_common.c index bd69df47..9718703e 100644 --- a/comedi/drivers/ni_mio_common.c +++ b/comedi/drivers/ni_mio_common.c @@ -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: