* [PATCH] sh: fix a kfree address in clkdev code
@ 2010-09-17 9:25 Guennadi Liakhovetski
2010-09-30 1:12 ` Paul Mundt
0 siblings, 1 reply; 2+ messages in thread
From: Guennadi Liakhovetski @ 2010-09-17 9:25 UTC (permalink / raw)
To: linux-sh
kfree() in clkdev_drop() function should actually be called with an address of
a struct clk_lookup_alloc object, and not struct clk_lookup, as presently done.
This just happens to work, because "struct clk_lookup cl" is the first
member in struct clk_lookup_alloc.
Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
---
arch/sh/kernel/clkdev.c | 4 +++-
1 files changed, 3 insertions(+), 1 deletions(-)
diff --git a/arch/sh/kernel/clkdev.c b/arch/sh/kernel/clkdev.c
index befc255..1f800ef 100644
--- a/arch/sh/kernel/clkdev.c
+++ b/arch/sh/kernel/clkdev.c
@@ -161,9 +161,11 @@ EXPORT_SYMBOL(clk_add_alias);
*/
void clkdev_drop(struct clk_lookup *cl)
{
+ struct clk_lookup_alloc *cla = container_of(cl, struct clk_lookup_alloc, cl);
+
mutex_lock(&clocks_mutex);
list_del(&cl->node);
mutex_unlock(&clocks_mutex);
- kfree(cl);
+ kfree(cla);
}
EXPORT_SYMBOL(clkdev_drop);
--
1.7.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] sh: fix a kfree address in clkdev code
2010-09-17 9:25 [PATCH] sh: fix a kfree address in clkdev code Guennadi Liakhovetski
@ 2010-09-30 1:12 ` Paul Mundt
0 siblings, 0 replies; 2+ messages in thread
From: Paul Mundt @ 2010-09-30 1:12 UTC (permalink / raw)
To: linux-sh
On Fri, Sep 17, 2010 at 11:25:10AM +0200, Guennadi Liakhovetski wrote:
> kfree() in clkdev_drop() function should actually be called with an address of
> a struct clk_lookup_alloc object, and not struct clk_lookup, as presently done.
> This just happens to work, because "struct clk_lookup cl" is the first
> member in struct clk_lookup_alloc.
>
> Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Applied, thanks.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2010-09-30 1:12 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-09-17 9:25 [PATCH] sh: fix a kfree address in clkdev code Guennadi Liakhovetski
2010-09-30 1:12 ` Paul Mundt
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).