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/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: Kees Cook <kees@kernel.org>
Reviewed-by: Dmitry 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: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>

authored by

Kees Cook and committed by
Dmitry Baryshkov
6f6f3535 f7bf1319

+1 -1
+1 -1
drivers/gpu/drm/msm/msm_iommu.c
··· 332 332 struct kmem_cache *pt_cache = get_pt_cache(mmu); 333 333 int ret; 334 334 335 - p->pages = kvmalloc_array(p->count, sizeof(p->pages), GFP_KERNEL); 335 + p->pages = kvmalloc_array(p->count, sizeof(*p->pages), GFP_KERNEL); 336 336 if (!p->pages) 337 337 return -ENOMEM; 338 338