From 31f0d2626e88d3c42d230700bf550b593da0112c Mon Sep 17 00:00:00 2001 From: Stephen Boyd Date: Tue, 14 Jul 2015 12:45:19 -0700 Subject: [PATCH] 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 Acked-by: Julia Lawall Cc: Sergej Sawazki Signed-off-by: Stephen Boyd --- drivers/clk/clk-gpio.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers/clk/clk-gpio.c b/drivers/clk/clk-gpio.c index c0d202c24a97e..41277a1526c76 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); -- 2.39.5