From: Sudip Mukherjee Date: Tue, 23 Feb 2016 09:30:03 +0000 (+0530) Subject: clk: shmobile: check for failure X-Git-Tag: next-20160301~10^2~24 X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=c7f23180c6025fc93d1b743a49a97c4bb0c26f19;p=karo-tx-linux.git clk: shmobile: check for failure We were not checking the return from devm_add_action() which can fail. Start using the helper devm_add_action_or_reset() and return directly as we know that the cleanup has been done by this helper. Signed-off-by: Sudip Mukherjee Signed-off-by: Stephen Boyd --- diff --git a/drivers/clk/shmobile/renesas-cpg-mssr.c b/drivers/clk/shmobile/renesas-cpg-mssr.c index 9a4d888164bb..925b6007e531 100644 --- a/drivers/clk/shmobile/renesas-cpg-mssr.c +++ b/drivers/clk/shmobile/renesas-cpg-mssr.c @@ -568,7 +568,11 @@ static int __init cpg_mssr_probe(struct platform_device *pdev) if (error) return error; - devm_add_action(dev, cpg_mssr_del_clk_provider, np); + error = devm_add_action_or_reset(dev, + cpg_mssr_del_clk_provider, + np); + if (error) + return error; error = cpg_mssr_add_clk_domain(dev, info->core_pm_clks, info->num_core_pm_clks);