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.
Also, the INSN_WRITE handlers for AO subdevices were incorrectly storing
the data value past the end of the data array for read-back, instead of
the last data value (when insn->n > 0).
Signed-off-by: Ian Abbott <abbotti@mev.co.uk>
for (n = 0; n < insn->n; n++)
outw(data[n], dev->iobase + ofs);
- devpriv->ao_data[chan] = data[n];
+ if (n > 0)
+ devpriv->ao_data[chan] = data[n - 1];
return n;
outb(0, dev->iobase + PCI1720_SYNCOUT); // update outputs
}
- devpriv->ao_data[chan] = data[n];
+ if (n > 0)
+ devpriv->ao_data[chan] = data[n - 1];
return n;
}