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 <abbotti@mev.co.uk>
static int dt282x_ao_insn_read(comedi_device * dev, comedi_subdevice * s,
comedi_insn * insn, lsampl_t * data)
{
+ if (insn->n == 0)
+ return 0;
+
data[0] = devpriv->ao[CR_CHAN(insn->chanspec)];
return 1;
sampl_t d;
unsigned int chan;
+ if (insn->n == 0)
+ return 0;
+
chan = CR_CHAN(insn->chanspec);
d = data[0];
d &= (1 << boardtype.dabits) - 1;