From 2984465175f711ae14f00a2ca3ea74ae3807fb27 Mon Sep 17 00:00:00 2001 From: Ian Abbott Date: Thu, 15 Dec 2011 18:31:00 +0000 Subject: [PATCH] unioxx5: 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/unioxx5.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/comedi/drivers/unioxx5.c b/comedi/drivers/unioxx5.c index 3dc865c8..dd4cf32c 100644 --- a/comedi/drivers/unioxx5.c +++ b/comedi/drivers/unioxx5.c @@ -162,6 +162,9 @@ static int unioxx5_subdev_read(comedi_device * dev, comedi_subdevice * subdev, unioxx5_subd_priv *usp = subdev->private; int channel, type; + if (insn->n == 0) + return 0; + channel = CR_CHAN(insn->chanspec); type = usp->usp_module_type[channel / 2]; /* defining module type(analog or digital) */ @@ -182,6 +185,9 @@ static int unioxx5_subdev_write(comedi_device * dev, comedi_subdevice * subdev, unioxx5_subd_priv *usp = subdev->private; int channel, type; + if (insn->n == 0) + return 0; + channel = CR_CHAN(insn->chanspec); type = usp->usp_module_type[channel / 2]; /* defining module type(analog or digital) */ -- 2.26.2