From: Frank Mori Hess Date: Mon, 19 Jul 2004 23:05:02 +0000 (+0000) Subject: fix null dereference on boards without analog output X-Git-Tag: r0_7_69~17 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=a5a9d006e6e1ced18b2bc78464c9aaa773ff34ee;p=comedi.git fix null dereference on boards without analog output --- diff --git a/comedi/drivers/cb_pcidas64.c b/comedi/drivers/cb_pcidas64.c index cfbc0c07..21262722 100644 --- a/comedi/drivers/cb_pcidas64.c +++ b/comedi/drivers/cb_pcidas64.c @@ -1366,6 +1366,7 @@ static int setup_subdevices(comedi_device *dev) } else { s->type = COMEDI_SUBD_UNUSED; + dev->write_subdev = NULL; } // digital input @@ -2948,13 +2949,14 @@ static void handle_ao_interrupt(comedi_device *dev, unsigned short status, unsigned int plx_status) { comedi_subdevice *s = dev->write_subdev; - comedi_async *async = s->async; - comedi_cmd *cmd = &async->cmd; + comedi_async *async; + comedi_cmd *cmd; uint8_t dma0_status; unsigned long flags; - /* board might not support ao, in which case async is NULL */ - if(async == NULL) return; + /* board might not support ao, in which case write_subdev is NULL */ + if(s == NULL) return; + async = s->async; cmd = &async->cmd; // spin lock makes sure noone else changes plx dma control reg