From d5ca73b470e340933602c2e69880a99010e40e65 Mon Sep 17 00:00:00 2001 From: Ian Abbott Date: Thu, 15 Dec 2011 19:44:40 +0000 Subject: [PATCH] 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 --- comedi/drivers/cb_pcidda.c | 3 +++ 1 file changed, 3 insertions(+) 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); -- 2.26.2