diff options
author | Rahul Kumar <rk0006818@gmail.com> | 2025-09-18 12:42:00 +0530 |
---|---|---|
committer | Alex Deucher <alexander.deucher@amd.com> | 2025-09-23 10:35:54 -0400 |
commit | 86a54e45fd91953e2b0e1aa15932112f135e4821 (patch) | |
tree | 9081236508f921b7c9819a6ead1d8dd574f2cbbc /rust/helpers/helpers.c | |
parent | 2f9c63883730a0bfecb086e6e59246933f936ca1 (diff) |
drm/amdgpu: Use kmalloc_array() instead of kmalloc()
Documentation/process/deprecated.rst recommends against the use of
kmalloc with dynamic size calculations due to the risk of overflow and
smaller allocation being made than the caller was expecting.
Replace kmalloc() with kmalloc_array() in amdgpu_amdkfd_gfx_v10.c,
amdgpu_amdkfd_gfx_v10_3.c, amdgpu_amdkfd_gfx_v11.c and
amdgpu_amdkfd_gfx_v12.c to make the intended allocation size clearer
and avoid potential overflow issues.
Suggested-by: Felix Kuehling <felix.kuehling@amd.com>
Signed-off-by: Rahul Kumar <rk0006818@gmail.com>
Signed-off-by: Felix Kuehling <felix.kuehling@amd.com>
Reviewed-by: Felix Kuehling <felix.kuehling@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'rust/helpers/helpers.c')
0 files changed, 0 insertions, 0 deletions