Commit f4a8f528 authored by Wolfgang Ocker's avatar Wolfgang Ocker Committed by Greg Kroah-Hartman

staging: comedi: style - use kmalloc_array(n, s, ...) instead of kmalloc(n*s, ...)

Fix a style issue reported by checkpatch.pl for the Eudyptula challenge
Signed-off-by: default avatarWolfgang Ocker <weo@weo1.de>
Reviewed-by: default avatarIan Abbott <abbotti@mev.co.uk>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 92271551
...@@ -1295,7 +1295,7 @@ static int do_insnlist_ioctl(struct comedi_device *dev, ...@@ -1295,7 +1295,7 @@ static int do_insnlist_ioctl(struct comedi_device *dev,
if (copy_from_user(&insnlist, arg, sizeof(insnlist))) if (copy_from_user(&insnlist, arg, sizeof(insnlist)))
return -EFAULT; return -EFAULT;
data = kmalloc(sizeof(unsigned int) * MAX_SAMPLES, GFP_KERNEL); data = kmalloc_array(MAX_SAMPLES, sizeof(unsigned int), GFP_KERNEL);
if (!data) { if (!data) {
ret = -ENOMEM; ret = -ENOMEM;
goto error; goto error;
...@@ -1376,7 +1376,7 @@ static int do_insn_ioctl(struct comedi_device *dev, ...@@ -1376,7 +1376,7 @@ static int do_insn_ioctl(struct comedi_device *dev,
unsigned int *data = NULL; unsigned int *data = NULL;
int ret = 0; int ret = 0;
data = kmalloc(sizeof(unsigned int) * MAX_SAMPLES, GFP_KERNEL); data = kmalloc_array(MAX_SAMPLES, sizeof(unsigned int), GFP_KERNEL);
if (!data) { if (!data) {
ret = -ENOMEM; ret = -ENOMEM;
goto error; goto error;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment