From a5a9d006e6e1ced18b2bc78464c9aaa773ff34ee Mon Sep 17 00:00:00 2001 From: Frank Mori Hess Date: Mon, 19 Jul 2004 23:05:02 +0000 Subject: [PATCH] fix null dereference on boards without analog output --- comedi/drivers/cb_pcidas64.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) 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 -- 2.26.2