summaryrefslogtreecommitdiff
path: root/drivers/video/tegra/host/host1x/host1x.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/video/tegra/host/host1x/host1x.c')
-rw-r--r--drivers/video/tegra/host/host1x/host1x.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/video/tegra/host/host1x/host1x.c b/drivers/video/tegra/host/host1x/host1x.c
index 5631189c354f..522219484286 100644
--- a/drivers/video/tegra/host/host1x/host1x.c
+++ b/drivers/video/tegra/host/host1x/host1x.c
@@ -206,11 +206,11 @@ static int nvhost_ioctl_ctrl_sync_fence_create(struct nvhost_ctrl_userctx *ctx,
name[0] = '\0';
}
- pts = kmalloc(sizeof(*pts) * args->num_pts, GFP_KERNEL);
+ pts = kmalloc_array(args->num_pts, sizeof(*pts), GFP_KERNEL);
if (!pts)
return -ENOMEM;
-
+ /* Multiplication overflow would have errored in kmalloc_array */
if (copy_from_user(pts, args_pts, sizeof(*pts) * args->num_pts)) {
err = -EFAULT;
goto out;