On Thu, Sep 17, 2026 at 11:13 PM Kees Cook <[email protected]> wrote:

> From: Kees Cook <[email protected]>
>
> In preparation for making the devm_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.)
>
> This allocates the single-entry array that mtk-eint expects (nbase is
> set to 1). The assigned type is "void __iomem **", but the converted
> allocation type would be "void __iomem ***", as the size was taken from
> "pctl->eint->base" itself rather than from what it points at. Luckily
> "void __iomem **" and "void __iomem *" are the same size. Take the size
> from the pointed-at type to match the assignment.
>
> Build tested ARCH=x86_64 allmodconfig with GCC 16.2.0:
> drivers/pinctrl/mediatek/pinctrl-mtk-common.o
>
> Assisted-by: LLM coccinelle
> Signed-off-by: Kees Cook <[email protected]>

Patch applied!

Yours,
Linus Walleij

Reply via email to