clk: sunxi: fix memory leaks
PATCH 1/1 clk: sunxi: fix memory leaks
When the if condition is true, "fixed" and "gate" should be free'd before return.
Signed-off-by Valentin Ilie <[email protected]>
--- drivers/clk/sunxi/clk-sunxi.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)
drivers/clk/sunxi/clk-sunxi.c +4 -1
@@ -48,8 +48,11 @@ static void __init sun4i_osc_clk_setup(struct device_node *node)return ; } -if (of_property_read_u32 (node,"clock-frequency" , &rate)) +if (of_property_read_u32 (node,"clock-frequency" , &rate)) { +kfree (fixed); +kfree (gate);return ; + }/* set up gate and fixed rate properties */ gate->reg =of_iomap (node,0 );
Signature · 1 line
1.8.1.2
Hi,
Quoted 3 lines · Valentin Ilie
When the if condition is true, "fixed" and "gate" should be free'd before return.
Signed-off-by Valentin Ilie <[email protected]>
A patch has already been submitted for this.
https://lkml.org/lkml/2013/10/18/524
Thanks anyway!
Maxime
Signature · 10 lines
Maxime Ripard, Free Electrons Embedded Linux, Kernel and Android engineering http://free-electrons.com -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 836 bytes Desc: Digital signature URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20131024/f86e9e0d/attachment.sig>