Commit 7af5b9ea authored by Dan Carpenter's avatar Dan Carpenter Committed by Stephen Boyd

clk: ti: fix double free in of_ti_divider_clk_setup()

The "div" pointer is freed in _register_divider() and again in
of_ti_divider_clk_setup().  Delete the free in _register_divider()

Fixes: fbbc1859 ("clk: ti: divider: cleanup _register_divider and ti_clk_get_div_table")
Signed-off-by: default avatarDan Carpenter <dan.carpenter@linaro.org>
Link: https://lore.kernel.org/r/6d36eeec-6c8a-4f11-a579-aa3cd7c38749@moroto.mountainReviewed-by: default avatarTony Lindgren <tony@atomide.com>
Signed-off-by: default avatarStephen Boyd <sboyd@kernel.org>
parent a5d14f8b
......@@ -309,7 +309,6 @@ static struct clk *_register_divider(struct device_node *node,
u32 flags,
struct clk_omap_divider *div)
{
struct clk *clk;
struct clk_init_data init;
const char *parent_name;
const char *name;
......@@ -326,12 +325,7 @@ static struct clk *_register_divider(struct device_node *node,
div->hw.init = &init;
/* register the clock */
clk = of_ti_clk_register(node, &div->hw, name);
if (IS_ERR(clk))
kfree(div);
return clk;
return of_ti_clk_register(node, &div->hw, name);
}
int ti_clk_parse_divider_data(int *div_table, int num_dividers, int max_div,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment