From: Ian Abbott Date: Mon, 22 Oct 2007 14:59:55 +0000 (+0000) Subject: Check dev->attached in interrupt routine. X-Git-Tag: r0_7_75~10 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=28f5d5e11cc96b4d65d193220236efee54b32935;p=comedi.git Check dev->attached in interrupt routine. --- diff --git a/comedi/drivers/amplc_dio200.c b/comedi/drivers/amplc_dio200.c index a443950c..e3770ff7 100644 --- a/comedi/drivers/amplc_dio200.c +++ b/comedi/drivers/amplc_dio200.c @@ -654,7 +654,7 @@ dio200_handle_read_intr(comedi_device *dev, comedi_subdevice *s) triggered = 0; comedi_spin_lock_irqsave(&subpriv->spinlock, flags); - oldevents = s->async ? s->async->events : 0; + oldevents = s->async->events; if (subpriv->has_int_sce) { /* * Collect interrupt sources that have triggered and disable @@ -693,7 +693,7 @@ dio200_handle_read_intr(comedi_device *dev, comedi_subdevice *s) outb(cur_enabled, subpriv->iobase); } - if (s->async && subpriv->active) { + if (subpriv->active) { /* * The command is still active. * @@ -740,7 +740,7 @@ dio200_handle_read_intr(comedi_device *dev, comedi_subdevice *s) } comedi_spin_unlock_irqrestore(&subpriv->spinlock, flags); - if (s->async && (oldevents != s->async->events)) { + if (oldevents != s->async->events) { comedi_event(dev, s); } @@ -971,6 +971,10 @@ dio200_interrupt(int irq, void *d PT_REGS_ARG) comedi_device *dev=d; int handled; + if (!dev->attached) { + return IRQ_NONE; + } + if (devpriv->intr_sd >= 0) { handled = dio200_handle_read_intr(dev, dev->subdevices + devpriv->intr_sd);