mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Vince Hsu <vinceh@nvidia.com>
To: <pdeschrijver@nvidia.com>, <pgaikwad@nvidia.com>,
	<mturquette@baylibre.com>, <sboyd@codeaurora.org>,
	<swarren@wwwdotorg.org>, <thierry.reding@gmail.com>,
	<gnurou@gmail.com>
Cc: <linux-clk@vger.kernel.org>, <linux-tegra@vger.kernel.org>,
	<linux-kernel@vger.kernel.org>, <vinceh@nvidia.com>,
	Vince Hsu <vince.h@nvidia.com>
Subject: [PATCH] clk: tegra: dfll: add missing rcu_read_unlock() for error path
Date: Wed, 16 Sep 2015 14:14:54 +0800	[thread overview]
Message-ID: <1442384094-22144-1-git-send-email-vinceh@nvidia.com> (raw)

From: Vince Hsu <vince.h@nvidia.com>

The commit e770940218028c6a5927fda45f2ca9db5d9b35e0 ("clk: tegra: dfll:
Properly protect OPP list") added the rcu_read_{lock,unlock} but missed
one in the error path. So add the missing one.

Signed-off-by: Vince Hsu <vince.h@nvidia.com>
---
Hi,

I noticed the missed unlock because we had a similar fix as the commit
e77094021 in ChromeOS[1]. 

[1] https://chromium-review.googlesource.com/#/c/223661/


 drivers/clk/tegra/clk-dfll.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/clk/tegra/clk-dfll.c b/drivers/clk/tegra/clk-dfll.c
index 4adff56dd0ef..c4e3a52e225b 100644
--- a/drivers/clk/tegra/clk-dfll.c
+++ b/drivers/clk/tegra/clk-dfll.c
@@ -685,8 +685,10 @@ static int find_lut_index_for_rate(struct tegra_dfll *td, unsigned long rate)
 	rcu_read_lock();
 
 	opp = dev_pm_opp_find_freq_ceil(td->soc->dev, &rate);
-	if (IS_ERR(opp))
+	if (IS_ERR(opp)) {
+		rcu_read_unlock();
 		return PTR_ERR(opp);
+	}
 	uv = dev_pm_opp_get_voltage(opp);
 
 	rcu_read_unlock();
-- 
2.1.4


             reply	other threads:[~2015-09-16  6:15 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-09-16  6:14 Vince Hsu [this message]
2015-09-16 22:15 ` Stephen Boyd
2015-09-17  1:17   ` Vince Hsu

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1442384094-22144-1-git-send-email-vinceh@nvidia.com \
    --to=vinceh@nvidia.com \
    --cc=gnurou@gmail.com \
    --cc=linux-clk@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-tegra@vger.kernel.org \
    --cc=mturquette@baylibre.com \
    --cc=pdeschrijver@nvidia.com \
    --cc=pgaikwad@nvidia.com \
    --cc=sboyd@codeaurora.org \
    --cc=swarren@wwwdotorg.org \
    --cc=thierry.reding@gmail.com \
    --cc=vince.h@nvidia.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®