]> git.hungrycats.org Git - linux/commitdiff
drm/exec: Use kvmalloc_objs for exec->objects
authorJonathan Cavitt <jonathan.cavitt@intel.com>
Wed, 1 Jul 2026 17:24:58 +0000 (01:24 +0800)
committerJonathan Cavitt <jonathan.cavitt@intel.com>
Tue, 7 Jul 2026 15:16:33 +0000 (23:16 +0800)
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
drivers/gpu/drm/drm_exec.c

index 7988f5e7d56a3e1c25528d468fe77cba737728d0..fa923852fae4509b946a2ce393b9219145727f25 100644 (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;