From beb3ae1314fa105ce40499c075d94e7eb361d62e Mon Sep 17 00:00:00 2001 From: Frank Mori Hess Date: Fri, 21 Mar 2008 18:45:23 +0000 Subject: [PATCH] Added missing spinlock around usage of devpriv->ai_mite_chan --- comedi/drivers/ni_mio_common.c | 5 +++++ 1 file changed, 5 insertions(+) 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; } -- 2.26.2