From: Frank Mori Hess Date: Mon, 28 Jun 2004 01:03:01 +0000 (+0000) Subject: fix possible crash when shared interrupt is asserted before X-Git-Tag: r0_7_69~29 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=00e2f365a35596e47705b657459364cd65c44353;p=comedi.git fix possible crash when shared interrupt is asserted before comedi_device_attach() has finished with postconfig() --- diff --git a/comedi/drivers.c b/comedi/drivers.c index 66f16ec0..527e711f 100644 --- a/comedi/drivers.c +++ b/comedi/drivers.c @@ -182,7 +182,7 @@ attached: printk("BUG: dev->board_name=<%p>\n",dev->board_name); dev->board_name="BUG"; } - barrier(); + mb(); dev->attached=1; return 0; diff --git a/comedi/drivers/ni_mio_common.c b/comedi/drivers/ni_mio_common.c index 8892704f..0200ae9a 100644 --- a/comedi/drivers/ni_mio_common.c +++ b/comedi/drivers/ni_mio_common.c @@ -375,6 +375,8 @@ static irqreturn_t ni_E_interrupt(int irq,void *d,struct pt_regs * regs) #ifdef PCIDMA struct mite_struct *mite = devpriv->mite; #endif + + if(dev->attached == 0) return IRQ_NONE; // lock to avoid race with comedi_poll comedi_spin_lock_irqsave(&dev->spinlock, flags); a_status=win_in(AI_Status_1_Register);