Skip to content

Commit

Permalink
clk: s2mps11: Fix a resource leak in error handling paths in the prob…
Browse files Browse the repository at this point in the history
…e function

[ Upstream commit d2d94fc ]

Some resource should be released in the error handling path of the probe
function, as already done in the remove function.

The remove function was fixed in commit bf416bd ("clk: s2mps11: Add
missing of_node_put and of_clk_del_provider")

Fixes: 7cc560d ("clk: s2mps11: Add support for s2mps11")
Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Link: https://lore.kernel.org/r/20201212122818.86195-1-christophe.jaillet@wanadoo.fr
Reviewed-by: Krzysztof Kozlowski <krzk@kernel.org>
Signed-off-by: Stephen Boyd <sboyd@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
  • Loading branch information
tititiou36 authored and gregkh committed Dec 30, 2020
1 parent 64f3af8 commit 75b84da
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions drivers/clk/clk-s2mps11.c
Expand Up @@ -195,6 +195,7 @@ static int s2mps11_clk_probe(struct platform_device *pdev)
return ret;

err_reg:
of_node_put(s2mps11_clks[0].clk_np);
while (--i >= 0)
clkdev_drop(s2mps11_clks[i].lookup);

Expand Down

0 comments on commit 75b84da

Please sign in to comment.