Skip to content

Commit 961c989

Browse files
committed
drm/plane: Remove const qualifier from plane->modifiers 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 "uint64_t *", but the returned type, while matching, will be const qualified. As there is no general way to remove const qualifiers, adjust the allocation type to match the assignment. Link: https://patch.msgid.link/20250426061325.work.665-kees@kernel.org Signed-off-by: Kees Cook <kees@kernel.org>
1 parent 5146f56 commit 961c989

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

drivers/gpu/drm/drm_plane.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -425,7 +425,7 @@ static int __drm_universal_plane_init(struct drm_device *dev,
425425

426426
plane->modifier_count = format_modifier_count;
427427
plane->modifiers = kmalloc_array(format_modifier_count,
428-
sizeof(format_modifiers[0]),
428+
sizeof(*plane->modifiers),
429429
GFP_KERNEL);
430430

431431
if (format_modifier_count && !plane->modifiers) {

0 commit comments

Comments
 (0)