aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/staging/comedi/drivers/usbduxsigma.c
diff options
context:
space:
mode:
authorH Hartley Sweeten <hsweeten@visionengravers.com>2014-08-25 15:23:46 -0700
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2014-08-30 13:20:50 -0700
commitd77ac2c487a37da53e9dd4554a0d6ff1a210fdeb (patch)
tree0e4882d3934e885151573ec6e71fecc3a5d38622 /drivers/staging/comedi/drivers/usbduxsigma.c
parentstaging: comedi: usbduxsigma: fix errno (EL2NSYNC) check (diff)
downloadlinux-dev-d77ac2c487a37da53e9dd4554a0d6ff1a210fdeb.tar.xz
linux-dev-d77ac2c487a37da53e9dd4554a0d6ff1a210fdeb.zip
staging: comedi: usbduxsigma: fix kcalloc 'size' argument
This code wants to allocate two arrays of struct urb pointers not two arrays of struct urb objects. The size argument for both kcalloc calls should be sizeof(urb) not sizeof(*urb). Reported by: coverity Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com> Reviewed-by: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging/comedi/drivers/usbduxsigma.c')
-rw-r--r--drivers/staging/comedi/drivers/usbduxsigma.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/drivers/staging/comedi/drivers/usbduxsigma.c b/drivers/staging/comedi/drivers/usbduxsigma.c
index da33b8c38d2e..a418be0aa822 100644
--- a/drivers/staging/comedi/drivers/usbduxsigma.c
+++ b/drivers/staging/comedi/drivers/usbduxsigma.c
@@ -1437,10 +1437,8 @@ static int usbduxsigma_alloc_usb_buffers(struct comedi_device *dev)
devpriv->dux_commands = kzalloc(SIZEOFDUXBUFFER, GFP_KERNEL);
devpriv->in_buf = kzalloc(SIZEINBUF, GFP_KERNEL);
devpriv->insn_buf = kzalloc(SIZEINSNBUF, GFP_KERNEL);
- devpriv->ai_urbs = kcalloc(devpriv->n_ai_urbs, sizeof(*urb),
- GFP_KERNEL);
- devpriv->ao_urbs = kcalloc(devpriv->n_ao_urbs, sizeof(*urb),
- GFP_KERNEL);
+ devpriv->ai_urbs = kcalloc(devpriv->n_ai_urbs, sizeof(urb), GFP_KERNEL);
+ devpriv->ao_urbs = kcalloc(devpriv->n_ao_urbs, sizeof(urb), GFP_KERNEL);
if (!devpriv->dux_commands || !devpriv->in_buf || !devpriv->insn_buf ||
!devpriv->ai_urbs || !devpriv->ao_urbs)
return -ENOMEM;