clk: ti: dra7-atl-clock: fix a memory leak
Subsystems (2)
PATCH 1/1 clk: ti: dra7-atl-clock: fix a memory leak
of_clk_add_provider makes an internal copy of the parent_names property while its called, thus it is no longer needed after this call and can be freed.
--- drivers/clk/ti/clk-dra7-atl.c | 1 + 1 file changed, 1 insertion(+)
drivers/clk/ti/clk-dra7-atl.c +1 -0
@@ -199,6 +199,7 @@ static void __init of_dra7_atl_clock_setup(struct device_node *node)if (!IS_ERR (clk)) {of_clk_add_provider (node, of_clk_src_simple_get, clk); +kfree (parent_names);return ; } cleanup:
Signature · 1 line
1.7.9.5
PATCH 1/1 clk: ti: dra7-atl-clock: fix a memory leak
Quoted 3 lines · Tero Kristo
of_clk_add_providermakes an internal copy of theparent_namesproperty while its called, thus it is no longer needed after this call and can be freed.
Thanks Tero, indeed this was overlooked in the original driver.
Quoted 20 lines
Signed-off-by Tero Kristo <[email protected]>Cc Mike Turquette <[email protected]>Cc Peter Ujfalusi <[email protected]>--- drivers/clk/ti/clk-dra7-atl.c | 1 + 1 file changed, 1 insertion(+)drivers/clk/ti/clk-dra7-atl.c +1
-0@@ -199,6 +199,7 @@ static void __init of_dra7_atl_clock_setup(struct device_node *node)if (!IS_ERR (clk)) {of_clk_add_provider (node, of_clk_src_simple_get, clk); +kfree (parent_names);return ; } cleanup:
Signature · 1 line
P?ter
Tero Kristo
AppliedPATCH 1/1 clk: ti: dra7-atl-clock: fix a memory leak
Quoted 8 lines · Peter Ujfalusi
Quoted 3 lines · Tero Kristo
of_clk_add_providermakes an internal copy of theparent_namesproperty while its called, thus it is no longer needed after this call and can be freed.Thanks Tero, indeed this was overlooked in the original driver.
Acked-by Peter Ujfalusi <[email protected]>
Applied to for-v3.18/ti-clk-driver.
-Tero
Quoted 24 lines
Quoted 22 lines
Signed-off-by Tero Kristo <[email protected]>Cc Mike Turquette <[email protected]>Cc Peter Ujfalusi <[email protected]>--- drivers/clk/ti/clk-dra7-atl.c | 1 + 1 file changed, 1 insertion(+)drivers/clk/ti/clk-dra7-atl.c +1
-0@@ -199,6 +199,7 @@ static void __init of_dra7_atl_clock_setup(struct device_node *node)if (!IS_ERR (clk)) {of_clk_add_provider (node, of_clk_src_simple_get, clk); +kfree (parent_names);return ; } cleanup: