[PATCH] clk: mediatek: mt7623: fix pericfg priv_auto size
Julien Stephan
jstephan at baylibre.com
Fri Mar 13 16:20:02 CET 2026
Le ven. 13 mars 2026 à 15:46, David Lechner <dlechner at baylibre.com> a écrit :
>
> Change the pericfg priv_auto size to mtk_clk_priv. The driver is
> registered using mtk_common_clk_infrasys_init() which expect that
> struct.
>
> The old value of struct mtk_cg_priv was larger, so there was no issue
> out of bounds access.
>
> Also replace tab with space to be consistent with the surrounding code.
>
> Reported-by: Julien Stephan <jstephan at baylibre.com>
> Closes: https://lore.kernel.org/u-boot/CAEHHSvYMiCZ4jAXp6jEhg6AhZ5Dv3_Ak-8H1mT7S2FPD3_X7dw@mail.gmail.com/
> Signed-off-by: David Lechner <dlechner at baylibre.com>
> ---
> drivers/clk/mediatek/clk-mt7623.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/clk/mediatek/clk-mt7623.c b/drivers/clk/mediatek/clk-mt7623.c
> index 071c4cf8a84..87720a93eff 100644
> --- a/drivers/clk/mediatek/clk-mt7623.c
> +++ b/drivers/clk/mediatek/clk-mt7623.c
> @@ -1187,7 +1187,7 @@ U_BOOT_DRIVER(mtk_clk_pericfg) = {
> .id = UCLASS_CLK,
> .of_match = mt7623_pericfg_compat,
> .probe = mt7623_pericfg_probe,
> - .priv_auto = sizeof(struct mtk_cg_priv),
> + .priv_auto = sizeof(struct mtk_clk_priv),
> .ops = &mtk_clk_infrasys_ops,
> .flags = DM_FLAG_PRE_RELOC,
> };
>
> ---
> base-commit: 9f1059bc735ec2a8d78c1f3e4fcab1fa3f428317
> change-id: 20260313-clk-mtk-fix-priv-auto-size-a2bddd467f41
>
> Best regards,
> --
> David Lechner <dlechner at baylibre.com>
>
Thank you for the quick fix!
Reviewed-by: Julien Stephan <jstephan at baylibre.com>
More information about the U-Boot
mailing list