Skip to content

Commit 258aebf

Browse files
keesLouis Chauvet
authored andcommitted
drm/vkms: Adjust vkms_state->active_planes allocation type
In preparation for making the kmalloc family of allocators type aware, we need to make sure that the returned type from the allocation matches the type of the variable being assigned. (Before, the allocator would always return "void *", which can be implicitly cast to any pointer type.) The assigned type is "struct vkms_plane_state **", but the returned type will be "struct drm_plane **". These are the same size (pointer size), but the types don't match. Adjust the allocation type to match the assignment. Signed-off-by: Kees Cook <[email protected]> Reviewed-by: Louis Chauvet <[email protected]> Fixes: 8b18658 ("drm/vkms: totally reworked crc data tracking") Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Louis Chauvet <[email protected]>
1 parent 6a5ca33 commit 258aebf

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/gpu/drm/vkms/vkms_crtc.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,7 @@ static int vkms_crtc_atomic_check(struct drm_crtc *crtc,
194194
i++;
195195
}
196196

197-
vkms_state->active_planes = kcalloc(i, sizeof(plane), GFP_KERNEL);
197+
vkms_state->active_planes = kcalloc(i, sizeof(*vkms_state->active_planes), GFP_KERNEL);
198198
if (!vkms_state->active_planes)
199199
return -ENOMEM;
200200
vkms_state->num_active_planes = i;

0 commit comments

Comments
 (0)