drm/exec: Use kvmalloc_objs for exec->objects
Subsystems (2)
PATCH 1/1 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 <[email protected]>
Cc Rob Clark <[email protected]>
Cc Christian König <[email protected]>
--- drivers/gpu/drm/drm_exec.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/drm_exec.c +1 -1
@@ -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 ;
Signature · 1 line
2.53.0
Quoted 8 lines · Jonathan Cavitt
Use
kvmalloc_objsinstead ofkvmalloc_arraywhen initializingexec->objectsindrm_exec_init.Concern caught by static analysis.
Signed-off-by Jonathan Cavitt <[email protected]>Cc Rob Clark <[email protected]>Cc Christian König <[email protected]>
Reviewed-by Christian König <[email protected]>
Quoted 17 lines
--- drivers/gpu/drm/drm_exec.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/gpu/drm/drm_exec.c +1
-1@@ -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 ;