fix possible crash when shared interrupt is asserted before
authorFrank Mori Hess <fmhess@speakeasy.net>
Mon, 28 Jun 2004 01:03:01 +0000 (01:03 +0000)
committerFrank Mori Hess <fmhess@speakeasy.net>
Mon, 28 Jun 2004 01:03:01 +0000 (01:03 +0000)
comedi_device_attach() has finished with postconfig()

comedi/drivers.c
comedi/drivers/ni_mio_common.c

index 66f16ec06559551eef03c766305ac80e343353c3..527e711f35b6b699f432b57f2d5fea429e093afb 100644 (file)
@@ -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;
index 8892704f9a9786e8614723d3bc94603a5ed702c3..0200ae9a24bf543608c60a2432bd98608c9fe553 100644 (file)
@@ -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);