]> git.ipfire.org Git - thirdparty/u-boot.git/commitdiff
clk: mediatek: mt7623: fix pericfg priv_auto size
authorDavid Lechner <dlechner@baylibre.com>
Fri, 13 Mar 2026 14:46:04 +0000 (09:46 -0500)
committerDavid Lechner <dlechner@baylibre.com>
Tue, 24 Mar 2026 17:32:02 +0000 (12:32 -0500)
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@baylibre.com>
Closes: https://lore.kernel.org/u-boot/CAEHHSvYMiCZ4jAXp6jEhg6AhZ5Dv3_Ak-8H1mT7S2FPD3_X7dw@mail.gmail.com/
Reviewed-by: Julien Stephan <jstephan@baylibre.com>
Link: https://patch.msgid.link/20260313-clk-mtk-fix-priv-auto-size-v1-1-bc649e1b301a@baylibre.com
Signed-off-by: David Lechner <dlechner@baylibre.com>
drivers/clk/mediatek/clk-mt7623.c

index 41bd91a8e05df90416ac9cec19632bfd65a7d569..0a302b405e20e89d675bf35776cbbb8a375840f8 100644 (file)
@@ -1194,7 +1194,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,
 };