Skip to content

Commit

Permalink
clk: npcm7xx: Fix incorrect kfree
Browse files Browse the repository at this point in the history
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.

Signed-off-by: Jonathan Neuschäfer <j.neuschaefer@gmx.net>
  • Loading branch information
neuschaefer committed Sep 23, 2023
1 parent b42be90 commit 6ea05fe
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/clk/clk-npcm7xx.c
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit 6ea05fe

Please sign in to comment.