diff options
author | Stephen Boyd <[email protected]> | 2015-07-14 12:45:19 -0700 |
---|---|---|
committer | Stephen Boyd <[email protected]> | 2015-07-28 11:51:39 -0700 |
commit | c5e857a46af24a772f445edcc01a861ee2d6a713 (patch) | |
tree | 1d4e9864101a7c05d01a5b05f46c19567d833838 | |
parent | 006cb8b66e18ce7aff934883f6c50e3b85052681 (diff) |
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: kbuild test robot <[email protected]>
Acked-by: Julia Lawall <[email protected]>
Cc: Sergej Sawazki <[email protected]>
Signed-off-by: Stephen Boyd <[email protected]>
-rw-r--r-- | drivers/clk/clk-gpio.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/drivers/clk/clk-gpio.c b/drivers/clk/clk-gpio.c index c0d202c24a97..41277a1526c7 100644 --- a/drivers/clk/clk-gpio.c +++ b/drivers/clk/clk-gpio.c @@ -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); |