Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

clk: npcm7xx: Fix incorrect kfree

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>

authored by

Jonathan Neuschäfer and committed by
Stephen Boyd
bbc5080b 43a354a2

+1 -1
+1 -1
drivers/clk/clk-npcm7xx.c
··· 510 510 return; 511 511 512 512 npcm7xx_init_fail: 513 - kfree(npcm7xx_clk_data->hws); 513 + kfree(npcm7xx_clk_data); 514 514 npcm7xx_init_np_err: 515 515 iounmap(clk_base); 516 516 npcm7xx_init_error: