[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20210104155709.406778571@linuxfoundation.org>
Date: Mon, 4 Jan 2021 16:57:05 +0100
From: Greg Kroah-Hartman <gregkh@...uxfoundation.org>
To: linux-kernel@...r.kernel.org
Cc: Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
stable@...r.kernel.org, Viresh Kumar <viresh.kumar@...aro.org>
Subject: [PATCH 5.10 12/63] opp: Call the missing clk_put() on error
From: Viresh Kumar <viresh.kumar@...aro.org>
commit 0e1d9ca1766f5d95fb881f57b6c4a1ffa63d4648 upstream.
Fix the clock reference counting by calling the missing clk_put() in the
error path.
Cc: v5.10 <stable@...r.kernel.org> # v5.10
Fixes: dd461cd9183f ("opp: Allow dev_pm_opp_get_opp_table() to return -EPROBE_DEFER")
Signed-off-by: Viresh Kumar <viresh.kumar@...aro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@...uxfoundation.org>
---
drivers/opp/core.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
--- a/drivers/opp/core.c
+++ b/drivers/opp/core.c
@@ -1111,7 +1111,7 @@ static struct opp_table *_allocate_opp_t
ret = dev_pm_opp_of_find_icc_paths(dev, opp_table);
if (ret) {
if (ret == -EPROBE_DEFER)
- goto remove_opp_dev;
+ goto put_clk;
dev_warn(dev, "%s: Error finding interconnect paths: %d\n",
__func__, ret);
@@ -1125,6 +1125,9 @@ static struct opp_table *_allocate_opp_t
list_add(&opp_table->node, &opp_tables);
return opp_table;
+put_clk:
+ if (!IS_ERR(opp_table->clk))
+ clk_put(opp_table->clk);
remove_opp_dev:
_remove_opp_dev(opp_dev, opp_table);
err:
Powered by blists - more mailing lists