From f66a4ad74a1b5c41f44b2531545cdcd419c1cdc8 Mon Sep 17 00:00:00 2001 From: Frank Mori Hess Date: Fri, 21 Mar 2008 18:48:51 +0000 Subject: [PATCH] ... and check that ai_mite_chan is not NULL after we have spinlock. --- comedi/drivers/ni_mio_common.c | 6 ++++++ 1 file changed, 6 insertions(+) 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: -- 2.26.2