linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] pinctrl: mediatek: Fix sizeof argument pctl->eint->base
@ 2025-04-24 13:12 Colin Ian King
  2025-04-29  8:38 ` Linus Walleij
  0 siblings, 1 reply; 2+ messages in thread
From: Colin Ian King @ 2025-04-24 13:12 UTC (permalink / raw)
  To: Sean Wang, Linus Walleij, Matthias Brugger,
	AngeloGioacchino Del Regno, Chen-Yu Tsai, linux-mediatek,
	linux-gpio, linux-arm-kernel
  Cc: kernel-janitors, linux-kernel

The sizeof argument is incorrect when allocating pctl->eint->base, it
should be *pctl->eint->base. (Generally, the size of void * is the same
as void ** so nothing is breaking in this specific case). Fix this.

Fixes: fe412e3a6c97 ("pinctrl: mediatek: common-v1: Fix EINT breakage on older controllers")
Signed-off-by: Colin Ian King <colin.i.king@gmail.com>
---
 drivers/pinctrl/mediatek/pinctrl-mtk-common.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/pinctrl/mediatek/pinctrl-mtk-common.c b/drivers/pinctrl/mediatek/pinctrl-mtk-common.c
index 8596f3541265..4c2b72a3543a 100644
--- a/drivers/pinctrl/mediatek/pinctrl-mtk-common.c
+++ b/drivers/pinctrl/mediatek/pinctrl-mtk-common.c
@@ -1017,7 +1017,7 @@ static int mtk_eint_init(struct mtk_pinctrl *pctl, struct platform_device *pdev)
 
 	pctl->eint->nbase = 1;
 	/* mtk-eint expects an array */
-	pctl->eint->base = devm_kzalloc(pctl->dev, sizeof(pctl->eint->base), GFP_KERNEL);
+	pctl->eint->base = devm_kzalloc(pctl->dev, sizeof(*pctl->eint->base), GFP_KERNEL);
 	if (!pctl->eint->base)
 		return -ENOMEM;
 
-- 
2.49.0



^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] pinctrl: mediatek: Fix sizeof argument pctl->eint->base
  2025-04-24 13:12 [PATCH] pinctrl: mediatek: Fix sizeof argument pctl->eint->base Colin Ian King
@ 2025-04-29  8:38 ` Linus Walleij
  0 siblings, 0 replies; 2+ messages in thread
From: Linus Walleij @ 2025-04-29  8:38 UTC (permalink / raw)
  To: Colin Ian King
  Cc: Sean Wang, Matthias Brugger, AngeloGioacchino Del Regno,
	Chen-Yu Tsai, linux-mediatek, linux-gpio, linux-arm-kernel,
	kernel-janitors, linux-kernel

On Thu, Apr 24, 2025 at 3:12 PM Colin Ian King <colin.i.king@gmail.com> wrote:

> The sizeof argument is incorrect when allocating pctl->eint->base, it
> should be *pctl->eint->base. (Generally, the size of void * is the same
> as void ** so nothing is breaking in this specific case). Fix this.
>
> Fixes: fe412e3a6c97 ("pinctrl: mediatek: common-v1: Fix EINT breakage on older controllers")
> Signed-off-by: Colin Ian King <colin.i.king@gmail.com>

The mtk eint handling has been refactored fixing this issue in the
process (AFAICT) so the patch does not apply to my devel branch.

Yours,
Linus Walleij


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2025-04-29  8:43 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-04-24 13:12 [PATCH] pinctrl: mediatek: Fix sizeof argument pctl->eint->base Colin Ian King
2025-04-29  8:38 ` Linus Walleij

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).