From d081b7b8f845e39b2653c5faf8502dc1232124aa Mon Sep 17 00:00:00 2001 From: Ian Abbott Date: Thu, 15 Dec 2011 20:57:29 +0000 Subject: [PATCH] das1800: don't access *data when insn->bits == 0 Due to recent change to do_insnlist_ioctl() and do_insn_ioctl(), the 'data' pointer will be NULL when insn->n == 0. Do not access *data in this case. Signed-off-by: Ian Abbott --- comedi/drivers/das1800.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/comedi/drivers/das1800.c b/comedi/drivers/das1800.c index d35b67e5..1e0defe4 100644 --- a/comedi/drivers/das1800.c +++ b/comedi/drivers/das1800.c @@ -1621,6 +1621,9 @@ static int das1800_ao_winsn(comedi_device * dev, comedi_subdevice * s, short output; unsigned long irq_flags; + if (insn->n == 0) + return 0; + // card expects two's complement data output = data[0] - (1 << (thisboard->resolution - 1)); // if the write is to the 'update' channel, we need to remember its value -- 2.26.2