staging: comedi: style - use kmalloc_array(n, s, ...) instead of kmalloc(n*s, ...)
authorWolfgang Ocker <weo@weo1.de>
Mon, 2 Jun 2014 20:48:06 +0000 (22:48 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 18 Jun 2014 22:04:20 +0000 (15:04 -0700)
Fix a style issue reported by checkpatch.pl for the Eudyptula challenge

Signed-off-by: Wolfgang Ocker <weo@weo1.de>
Reviewed-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/comedi/comedi_fops.c

index 9d99fb3c18a65d4b25dd4c20e40d84abf78871b4..c54ed42f8310faf5739fa89172b1ee779a253e72 100644 (file)
@@ -1295,7 +1295,7 @@ static int do_insnlist_ioctl(struct comedi_device *dev,
        if (copy_from_user(&insnlist, arg, sizeof(insnlist)))
                return -EFAULT;
 
-       data = kmalloc(sizeof(unsigned int) * MAX_SAMPLES, GFP_KERNEL);
+       data = kmalloc_array(MAX_SAMPLES, sizeof(unsigned int), GFP_KERNEL);
        if (!data) {
                ret = -ENOMEM;
                goto error;
@@ -1376,7 +1376,7 @@ static int do_insn_ioctl(struct comedi_device *dev,
        unsigned int *data = NULL;
        int ret = 0;
 
-       data = kmalloc(sizeof(unsigned int) * MAX_SAMPLES, GFP_KERNEL);
+       data = kmalloc_array(MAX_SAMPLES, sizeof(unsigned int), GFP_KERNEL);
        if (!data) {
                ret = -ENOMEM;
                goto error;