From: Alban Browaeys <alban.browaeys@gmail.com>
To: Tomeu Vizoso <tomeu.vizoso@collabora.com>,
Mike Turquette <mturquette@linaro.org>,
Stephen Boyd <sboyd@codeaurora.org>
Cc: linux-kernel@vger.kernel.org, Alban Browaeys <prahal@yahoo.com>
Subject: [PATCH 2/2] clk: Fix OOPS calling hlist_del on an already poisoned hlist.
Date: Thu, 5 Feb 2015 19:24:50 +0100 [thread overview]
Message-ID: <1423160690-7853-2-git-send-email-prahal@yahoo.com> (raw)
In-Reply-To: <1423160690-7853-1-git-send-email-prahal@yahoo.com>
Put is called more than once, thus hlist_del ends up on a poisoned
list.
Move hlist_del to the __clk_release handler managed by kref instead
of calling it in _clk_put.
Fixes: 1c8e600440c7 ("clk: Add rate constraints to clocks")
Signed-off-by: Alban Browaeys <prahal@yahoo.com>
---
drivers/clk/clk.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/drivers/clk/clk.c b/drivers/clk/clk.c
index 8f33722..f1d4b33 100644
--- a/drivers/clk/clk.c
+++ b/drivers/clk/clk.c
@@ -2489,6 +2489,9 @@ static void __clk_release(struct kref *ref)
struct clk *clk = container_of(&core, struct clk, core);
int i = core->num_parents;
+ hlist_del(&clk->child_node);
+ clk_core_set_rate_nolock(clk->core, clk->core->req_rate);
+
kfree(core->parents);
while (--i >= 0)
kfree_const(core->parent_names[i]);
@@ -2666,8 +2669,6 @@ void __clk_put(struct clk *clk)
clk_prepare_lock();
- hlist_del(&clk->child_node);
- clk_core_set_rate_nolock(clk->core, clk->core->req_rate);
owner = clk->core->owner;
kref_put(&clk->core->ref, __clk_release);
--
2.1.4
next prev parent reply other threads:[~2015-02-05 18:25 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-02-05 18:24 [PATCH 1/2] clk: Fix __clk_get access to already freed owner field Alban Browaeys
2015-02-05 18:24 ` Alban Browaeys [this message]
2015-02-05 19:33 ` [PATCH 2/2] clk: Fix OOPS calling hlist_del on an already poisoned hlist Stephen Boyd
2015-02-05 20:56 ` Alban Browaeys
2015-02-05 19:30 ` [PATCH 1/2] clk: Fix __clk_get access to already freed owner field Stephen Boyd
2015-02-05 20:43 ` Alban Browaeys
2015-02-05 21:03 ` Stephen Boyd
2015-02-05 21:30 ` Alban Browaeys
2015-02-05 21:45 ` Stephen Boyd
2015-02-06 9:52 ` Alban Browaeys
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=1423160690-7853-2-git-send-email-prahal@yahoo.com \
--to=alban.browaeys@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mturquette@linaro.org \
--cc=prahal@yahoo.com \
--cc=sboyd@codeaurora.org \
--cc=tomeu.vizoso@collabora.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
Powered by JetHome