pinctrl: mediatek: Fix sizeof argument pctl->eint->base
Subsystems (5)
PATCH 1/1 pinctrl: mediatek: Fix sizeof argument pctl->eint->base
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 <[email protected]>
--- drivers/pinctrl/mediatek/pinctrl-mtk-common.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/pinctrl/mediatek/pinctrl-mtk-common.c +1 -1
@@ -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 ;
Signature · 1 line
2.49.0
Quoted 6 lines · Colin Ian King
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 <[email protected]>
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