From: Bernard Zhao Date: Wed, 31 Mar 2021 13:12:18 +0000 (-0700) Subject: drm/amd: use kmalloc_array over kmalloc with multiply X-Git-Tag: accepted/tizen/unified/20230118.172025~7243^2~10^2~52 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=ccc4343041f21023a321ba36c5de8dff2ba6121a;p=platform%2Fkernel%2Flinux-rpi.git drm/amd: use kmalloc_array over kmalloc with multiply Fix patch check warning: WARNING: Prefer kmalloc_array over kmalloc with multiply + buf = kmalloc(MAX_KFIFO_SIZE * sizeof(*buf), GFP_KERNEL); Signed-off-by: Bernard Zhao Signed-off-by: Alex Deucher --- diff --git a/drivers/gpu/drm/amd/amdkfd/kfd_smi_events.c b/drivers/gpu/drm/amd/amdkfd/kfd_smi_events.c index 17d1736..2465224 100644 --- a/drivers/gpu/drm/amd/amdkfd/kfd_smi_events.c +++ b/drivers/gpu/drm/amd/amdkfd/kfd_smi_events.c @@ -81,7 +81,7 @@ static ssize_t kfd_smi_ev_read(struct file *filep, char __user *user, struct kfd_smi_client *client = filep->private_data; unsigned char *buf; - buf = kmalloc(MAX_KFIFO_SIZE * sizeof(*buf), GFP_KERNEL); + buf = kmalloc_array(MAX_KFIFO_SIZE, sizeof(*buf), GFP_KERNEL); if (!buf) return -ENOMEM;