clk: npcm7xx: Fix incorrect kfree
authorJonathan Neuschäfer <j.neuschaefer@gmx.net>
Sat, 23 Sep 2023 13:31:27 +0000 (15:31 +0200)
committerStephen Boyd <sboyd@kernel.org>
Thu, 19 Oct 2023 01:06:05 +0000 (18:06 -0700)
The corresponding allocation is:

> npcm7xx_clk_data = kzalloc(struct_size(npcm7xx_clk_data, hws,
>       NPCM7XX_NUM_CLOCKS), GFP_KERNEL);

... so, kfree should be applied to npcm7xx_clk_data, not
npcm7xx_clk_data->hws.

Fixes: fcfd14369856 ("clk: npcm7xx: add clock controller")
Signed-off-by: Jonathan Neuschäfer <j.neuschaefer@gmx.net>
Link: https://lore.kernel.org/r/20230923133127.1815621-1-j.neuschaefer@gmx.net
Signed-off-by: Stephen Boyd <sboyd@kernel.org>
drivers/clk/clk-npcm7xx.c

index e319cfa51a8a3ff99a742144c98f3b916fcad83c..030186def9c69a9e2b9be72de96128970a972de3 100644 (file)
@@ -510,7 +510,7 @@ static void __init npcm7xx_clk_init(struct device_node *clk_np)
        return;
 
 npcm7xx_init_fail:
-       kfree(npcm7xx_clk_data->hws);
+       kfree(npcm7xx_clk_data);
 npcm7xx_init_np_err:
        iounmap(clk_base);
 npcm7xx_init_error: