Commit 6f6f3535 authored by Kees Cook's avatar Kees Cook Committed by Dmitry Baryshkov
Browse files

drm/msm: Adjust msm_iommu_pagetable_prealloc_allocate() 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 "void **" but the returned type will be "void ***".
These are the same allocation size (pointer size), but the types do not
match. Adjust the allocation type to match the assignment.

Signed-off-by: default avatarKees Cook <kees@kernel.org>
Reviewed-by: default avatarDmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>
Patchwork: https://patchwork.freedesktop.org/patch/703588/
Link: https://lore.kernel.org/r/20260206222151.work.016-kees@kernel.org


Signed-off-by: default avatarDmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>
parent f7bf1319
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -332,7 +332,7 @@ msm_iommu_pagetable_prealloc_allocate(struct msm_mmu *mmu, struct msm_mmu_preall
	struct kmem_cache *pt_cache = get_pt_cache(mmu);
	int ret;

	p->pages = kvmalloc_array(p->count, sizeof(p->pages), GFP_KERNEL);
	p->pages = kvmalloc_array(p->count, sizeof(*p->pages), GFP_KERNEL);
	if (!p->pages)
		return -ENOMEM;