Skip to content

Commit b2602a8

Browse files
keesAndi Shyti
authored andcommitted
drm/i915/gt: Remove const from struct i915_wa list allocation
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 i915_wa *". The returned type, while technically matching, will be const qualified. As there is no general way to remove const qualifiers, adjust the allocation type to match the assignment. Signed-off-by: Kees Cook <[email protected]> Acked-by: Jani Nikula <[email protected]> Reviewed-by: Andi Shyti <[email protected]> Signed-off-by: Andi Shyti <[email protected]> Link: https://lore.kernel.org/r/[email protected]
1 parent d26e550 commit b2602a8

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/gpu/drm/i915/gt/intel_workarounds.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,7 @@ static void _wa_add(struct i915_wa_list *wal, const struct i915_wa *wa)
156156
if (IS_ALIGNED(wal->count, grow)) { /* Either uninitialized or full. */
157157
struct i915_wa *list;
158158

159-
list = kmalloc_array(ALIGN(wal->count + 1, grow), sizeof(*wa),
159+
list = kmalloc_array(ALIGN(wal->count + 1, grow), sizeof(*list),
160160
GFP_KERNEL);
161161
if (!list) {
162162
drm_err(&i915->drm, "No space for workaround init!\n");

0 commit comments

Comments
 (0)