提交 c5e857a4 编写于 作者: S Stephen Boyd

clk: gpio: Unlock mutex on error path

We don't unlock the mutex if we fail to allocate the parent names
array. Unlock it and return an error in this case as well.
Reported-by: Nkbuild test robot <fengguang.wu@intel.com>
Acked-by: NJulia Lawall <julia.lawall@lip6.fr>
Cc: Sergej Sawazki <ce3a@gmx.de>
Signed-off-by: NStephen Boyd <sboyd@codeaurora.org>
上级 006cb8b6
......@@ -251,8 +251,10 @@ static struct clk *of_clk_gpio_delayed_register_get(
num_parents = of_clk_get_parent_count(data->node);
parent_names = kcalloc(num_parents, sizeof(char *), GFP_KERNEL);
if (!parent_names)
return ERR_PTR(-ENOMEM);
if (!parent_names) {
clk = ERR_PTR(-ENOMEM);
goto out;
}
for (i = 0; i < num_parents; i++)
parent_names[i] = of_clk_get_parent_name(data->node, i);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册