cb_pcidda: don't access *data when insn->n == 0
authorIan Abbott <abbotti@mev.co.uk>
Thu, 15 Dec 2011 19:44:40 +0000 (19:44 +0000)
committerIan Abbott <abbotti@mev.co.uk>
Thu, 15 Dec 2011 19:44:40 +0000 (19:44 +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/cb_pcidda.c

index 74b8fe036eb651ea6e1f2b174917888a2475d153..5f08f0cdd39ae36396d07b2f28e4e787e98dcb68 100644 (file)
@@ -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);