vcsm: Fix "Prefer kcalloc over kzalloc with multiply"
authorDave Stevenson <dave.stevenson@raspberrypi.org>
Fri, 1 Sep 2017 16:47:32 +0000 (17:47 +0100)
committerpopcornmix <popcornmix@gmail.com>
Tue, 5 Sep 2017 16:45:44 +0000 (17:45 +0100)
Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.org>
drivers/char/broadcom/vc_sm/vmcs_sm.c

index 32333c6c23c1ecedc465289d2d416d9c083a823b..a18407d111c471878c07936b56425a16f4fdf81f 100644 (file)
@@ -2984,7 +2984,9 @@ static long vc_sm_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
                                        ret = -EFAULT;
                                        goto out;
                                }
-                               block = kzalloc(ioparam.op_count * sizeof(struct vmcs_sm_ioctl_clean_invalid_block), GFP_KERNEL);
+                               block = kcalloc(ioparam.op_count,
+                                               sizeof(struct vmcs_sm_ioctl_clean_invalid_block),
+                                               GFP_KERNEL);
                                if (!block) {
                                        ret = -EFAULT;
                                        goto out;