projects
/
comedi.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
d5c00f1
)
ni_at_ao: don't access *data when insn->n == 0
author
Ian Abbott
<abbotti@mev.co.uk>
Thu, 15 Dec 2011 21:04:50 +0000
(21:04 +0000)
committer
Ian Abbott
<abbotti@mev.co.uk>
Thu, 15 Dec 2011 21:04:50 +0000
(21:04 +0000)
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>
comedi/drivers/ni_at_ao.c
patch
|
blob
|
history
diff --git
a/comedi/drivers/ni_at_ao.c
b/comedi/drivers/ni_at_ao.c
index 17d055e61545e8aa0d480175a3f21951cc3ddfcb..d0dcf45e59f7adc677b9b34fd5c5a3e8ffd82773 100644
(file)
--- a/
comedi/drivers/ni_at_ao.c
+++ b/
comedi/drivers/ni_at_ao.c
@@
-434,6
+434,9
@@
static int atao_calib_insn_write(comedi_device * dev, comedi_subdevice * s,
unsigned int bitstring, bit;
unsigned int chan = CR_CHAN(insn->chanspec);
+ if (insn->n == 0)
+ return 0;
+
bitstring = ((chan & 0x7) << 8) | (data[insn->n - 1] & 0xff);
for (bit = 1 << (11 - 1); bit; bit >>= 1) {