From: Ian Abbott Date: Thu, 15 Dec 2011 19:44:40 +0000 (+0000) Subject: cb_pcidda: don't access *data when insn->n == 0 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=d5ca73b470e340933602c2e69880a99010e40e65;p=comedi.git cb_pcidda: don't access *data when insn->n == 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 --- diff --git a/comedi/drivers/cb_pcidda.c b/comedi/drivers/cb_pcidda.c index 74b8fe03..5f08f0cd 100644 --- a/comedi/drivers/cb_pcidda.c +++ b/comedi/drivers/cb_pcidda.c @@ -604,6 +604,9 @@ static int cb_pcidda_ao_winsn(comedi_device * dev, comedi_subdevice * s, unsigned int command; unsigned int channel, range; + if (insn->n == 0) + return 0; + channel = CR_CHAN(insn->chanspec); range = CR_RANGE(insn->chanspec);