drm/exec: Use kvmalloc_objs for exec->objects

Use kvmalloc_objs instead of kvmalloc_array when initializing
exec->objects in drm_exec_init.

Concern caught by static analysis.

Signed-off-by: Jonathan Cavitt <jonathan.cavitt@intel.com>
Cc: Rob Clark <robdclark@chromium.org>
Cc: Christian König <christian.koenig@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
Link: https://patch.msgid.link/20260701172458.1416930-1-jonathan.cavitt@intel.com
This commit is contained in:
Jonathan Cavitt
2026-07-07 23:16:33 +08:00
parent 1f223eb221
commit a8eba56abc
+1 -1
View File
@@ -79,7 +79,7 @@ void drm_exec_init(struct drm_exec *exec, u32 flags, unsigned nr)
nr = PAGE_SIZE / sizeof(void *);
exec->flags = flags;
exec->objects = kvmalloc_array(nr, sizeof(void *), GFP_KERNEL);
exec->objects = kvmalloc_objs(*exec->objects, nr, GFP_KERNEL);
/* If allocation here fails, just delay that till the first use */
exec->max_objects = exec->objects ? nr : 0;