From: Frank Mori Hess Date: Fri, 21 Mar 2008 18:45:23 +0000 (+0000) Subject: Added missing spinlock around usage of devpriv->ai_mite_chan X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=beb3ae1314fa105ce40499c075d94e7eb361d62e;p=comedi.git Added missing spinlock around usage of devpriv->ai_mite_chan --- diff --git a/comedi/drivers/ni_mio_common.c b/comedi/drivers/ni_mio_common.c index 3cd24abd..bd69df47 100644 --- a/comedi/drivers/ni_mio_common.c +++ b/comedi/drivers/ni_mio_common.c @@ -1542,6 +1542,7 @@ static int ni_ai_setup_MITE_dma(comedi_device * dev) { comedi_subdevice *s = dev->subdevices + NI_AI_SUBDEV; int retval; + unsigned long flags; retval = ni_request_ai_mite_channel(dev); if (retval) @@ -1551,6 +1552,8 @@ static int ni_ai_setup_MITE_dma(comedi_device * dev) /* write alloc the entire buffer */ comedi_buf_write_alloc(s->async, s->async->prealloc_bufsz); + + comedi_spin_lock_irqsave(&devpriv->mite_channel_lock, flags); switch (boardtype.reg_type) { case ni_reg_611x: case ni_reg_6143: @@ -1565,6 +1568,8 @@ static int ni_ai_setup_MITE_dma(comedi_device * dev) }; /*start the MITE */ mite_dma_arm(devpriv->ai_mite_chan); + comedi_spin_unlock_irqrestore(&devpriv->mite_channel_lock, flags); + return 0; }