projects
/
platform
/
kernel
/
linux-starfive.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
5a43452
)
drm/amd: use kmalloc_array over kmalloc with multiply
author
Bernard Zhao
<bernard@vivo.com>
Wed, 31 Mar 2021 13:12:18 +0000
(06:12 -0700)
committer
Alex Deucher
<alexander.deucher@amd.com>
Fri, 9 Apr 2021 20:50:26 +0000
(16:50 -0400)
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 <bernard@vivo.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/amdkfd/kfd_smi_events.c
patch
|
blob
|
history
diff --git
a/drivers/gpu/drm/amd/amdkfd/kfd_smi_events.c
b/drivers/gpu/drm/amd/amdkfd/kfd_smi_events.c
index 17d1736367ea3e7ab9dddb123594434b57504b2e..2465224235593ce8660f78375941148541ab9565 100644
(file)
--- 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;