ARM: fix a kfree address in clkdev code
PATCH 1/1 ARM: fix a kfree address in clkdev code
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.
---
Jean-Christophe, as I said, this is a purely academic patch, I'll send a similar one to sh, but if your consolidation patch is accepted for 2.6.37, maybe you can just adjust yours to get to the desired result. If, however, these two patches are merged into 2.6.36, you'll need slightly larger adjustments to your patch, in both cases trivial though.
arch/arm/common/clkdev.c | 4 +++- 1 files changed, 3 insertions(+), 1 deletions(-)
arch/arm/common/clkdev.c +3 -1
@@ -171,9 +171,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);
Signature · 1 line
1.7.1
PATCH 1/1 ARM: fix a kfree address in clkdev code
Quoted 10 lines · Guennadi Liakhovetski
kfree()inclkdev_drop()function should actually be called with an address of a structclk_lookup_allocobject, and not structclk_lookup, as presently done. This just happens to work, because "structclk_lookupcl" is the first member in structclk_lookup_alloc.Signed-off-by Guennadi Liakhovetski <[email protected]>---
Jean-Christophe, as I said, this is a purely academic patch, I'll send a similar one to sh, but if your consolidation patch is accepted for 2.6.37,
I follow the sh too :)
Quoted 3 lines
maybe you can just adjust yours to get to the desired result. If, however, these two patches are merged into 2.6.36, you'll need slightly larger adjustments to your patch, in both cases trivial though.
ok I'll update if need it
Best Regards,
J.