Skip to content

Commit

Permalink
clk: st: clk-flexgen: Unmap region obtained by of_iomap
Browse files Browse the repository at this point in the history
Free memory mapping, if probe is not successful.

Signed-off-by: Arvind Yadav <arvind.yadav.cs@gmail.com>
Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
  • Loading branch information
Arvind Yadav authored and Stephen Boyd committed Dec 9, 2016
1 parent 113ff9c commit 16cd776
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion drivers/clk/st/clk-flexgen.c
Original file line number Diff line number Diff line change
Expand Up @@ -329,8 +329,10 @@ static void __init st_of_flexgen_setup(struct device_node *np)
return;

parents = flexgen_get_parents(np, &num_parents);
if (!parents)
if (!parents) {
iounmap(reg);
return;
}

match = of_match_node(flexgen_of_match, np);
if (match) {
Expand Down Expand Up @@ -394,6 +396,7 @@ static void __init st_of_flexgen_setup(struct device_node *np)
return;

err:
iounmap(reg);
if (clk_data)
kfree(clk_data->clks);
kfree(clk_data);
Expand Down

0 comments on commit 16cd776

Please sign in to comment.