Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

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 <kees@kernel.org>
Reviewed-by: Louis Chauvet <louis.chauvet@bootlin.com>
Fixes: 8b1865873651 ("drm/vkms: totally reworked crc data tracking")
Link: https://lore.kernel.org/r/20250426061431.work.304-kees@kernel.org
Signed-off-by: Louis Chauvet <contact@louischauvet.fr>

authored by

Kees Cook and committed by
Louis Chauvet
258aebf1 6a5ca33b

+1 -1
+1 -1
drivers/gpu/drm/vkms/vkms_crtc.c
··· 194 194 i++; 195 195 } 196 196 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); 198 198 if (!vkms_state->active_planes) 199 199 return -ENOMEM; 200 200 vkms_state->num_active_planes = i;