]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
drm/amdkfd: Use kvcalloc to allocate arrays
authorDavid Francis <David.Francis@amd.com>
Thu, 25 Jun 2026 14:09:13 +0000 (10:09 -0400)
committerAlex Deucher <alexander.deucher@amd.com>
Wed, 1 Jul 2026 17:01:50 +0000 (13:01 -0400)
commit9c8b85f95c1d4736b967e17b8eb4a463c055bea3
treeb9718a906683b30c475c0a0bd56a7c2085fbc6e2
parent166e1100c175093729fd048efef3cd3108e6bfb2
drm/amdkfd: Use kvcalloc to allocate arrays

There were a few instances in kfd_chardev.c of kvzalloc being
used to allocate memory for an array.

Switch those to kvcalloc, which
- is the standard way of allocating a zero-initialized array
- does a check for the mul overflowing

Signed-off-by: David Francis <David.Francis@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
(cherry picked from commit 60b048c93f7a3add39757ad65fe2bb6e58eeae23)
Cc: stable@vger.kernel.org
drivers/gpu/drm/amd/amdkfd/kfd_chardev.c