* [PATCH] powerpc: Remove double free
@ 2019-05-15 9:07 Tobin C. Harding
2019-05-15 9:26 ` Christophe Leroy
2019-05-18 11:15 ` Michael Ellerman
0 siblings, 2 replies; 4+ messages in thread
From: Tobin C. Harding @ 2019-05-15 9:07 UTC (permalink / raw)
To: Benjamin Herrenschmidt, Paul Mackerras, Michael Ellerman
Cc: Tobin C. Harding, Greg Kroah-Hartman, linuxppc-dev, linux-kernel
kfree() after kobject_put(). Who ever wrote this was on crack.
Fixes: 7e8039795a80 ("powerpc/cacheinfo: Fix kobject memleak")
Signed-off-by: Tobin C. Harding <tobin@kernel.org>
---
FTR
git log --pretty=format:"%h%x09%an%x09%ad%x09%s" | grep 7e8039795a80
7e8039795a80 Tobin C. Harding Tue Apr 30 11:09:23 2019 +1000 powerpc/cacheinfo: Fix kobject memleak
arch/powerpc/kernel/cacheinfo.c | 1 -
1 file changed, 1 deletion(-)
diff --git a/arch/powerpc/kernel/cacheinfo.c b/arch/powerpc/kernel/cacheinfo.c
index f2ed3ef4b129..862e2890bd3d 100644
--- a/arch/powerpc/kernel/cacheinfo.c
+++ b/arch/powerpc/kernel/cacheinfo.c
@@ -767,7 +767,6 @@ static void cacheinfo_create_index_dir(struct cache *cache, int index,
cache_dir->kobj, "index%d", index);
if (rc) {
kobject_put(&index_dir->kobj);
- kfree(index_dir);
return;
}
--
2.21.0
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH] powerpc: Remove double free
2019-05-15 9:07 [PATCH] powerpc: Remove double free Tobin C. Harding
@ 2019-05-15 9:26 ` Christophe Leroy
2019-05-15 11:30 ` Greg Kroah-Hartman
2019-05-18 11:15 ` Michael Ellerman
1 sibling, 1 reply; 4+ messages in thread
From: Christophe Leroy @ 2019-05-15 9:26 UTC (permalink / raw)
To: Tobin C. Harding, Benjamin Herrenschmidt, Paul Mackerras,
Michael Ellerman
Cc: Greg Kroah-Hartman, linuxppc-dev, linux-kernel
kobject_put() released index_dir->kobj
but who will release 'index' ?
Christophe
Le 15/05/2019 à 11:07, Tobin C. Harding a écrit :
> kfree() after kobject_put(). Who ever wrote this was on crack.
>
> Fixes: 7e8039795a80 ("powerpc/cacheinfo: Fix kobject memleak")
> Signed-off-by: Tobin C. Harding <tobin@kernel.org>
> ---
>
> FTR
>
> git log --pretty=format:"%h%x09%an%x09%ad%x09%s" | grep 7e8039795a80
> 7e8039795a80 Tobin C. Harding Tue Apr 30 11:09:23 2019 +1000 powerpc/cacheinfo: Fix kobject memleak
>
> arch/powerpc/kernel/cacheinfo.c | 1 -
> 1 file changed, 1 deletion(-)
>
> diff --git a/arch/powerpc/kernel/cacheinfo.c b/arch/powerpc/kernel/cacheinfo.c
> index f2ed3ef4b129..862e2890bd3d 100644
> --- a/arch/powerpc/kernel/cacheinfo.c
> +++ b/arch/powerpc/kernel/cacheinfo.c
> @@ -767,7 +767,6 @@ static void cacheinfo_create_index_dir(struct cache *cache, int index,
> cache_dir->kobj, "index%d", index);
> if (rc) {
> kobject_put(&index_dir->kobj);
> - kfree(index_dir);
> return;
> }
>
>
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] powerpc: Remove double free
2019-05-15 9:26 ` Christophe Leroy
@ 2019-05-15 11:30 ` Greg Kroah-Hartman
0 siblings, 0 replies; 4+ messages in thread
From: Greg Kroah-Hartman @ 2019-05-15 11:30 UTC (permalink / raw)
To: Christophe Leroy
Cc: Tobin C. Harding, Benjamin Herrenschmidt, Paul Mackerras,
Michael Ellerman, linuxppc-dev, linux-kernel
On Wed, May 15, 2019 at 11:26:03AM +0200, Christophe Leroy wrote:
> kobject_put() released index_dir->kobj
Yes, but what is that kobject enclosed in?
> but who will release 'index' ?
The final kobject_put() will do that, see cacheinfo_create_index_dir()
for the details.
And please do not top-post, you lost all context.
greg k-h
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] powerpc: Remove double free
2019-05-15 9:07 [PATCH] powerpc: Remove double free Tobin C. Harding
2019-05-15 9:26 ` Christophe Leroy
@ 2019-05-18 11:15 ` Michael Ellerman
1 sibling, 0 replies; 4+ messages in thread
From: Michael Ellerman @ 2019-05-18 11:15 UTC (permalink / raw)
To: Tobin C. Harding, Benjamin Herrenschmidt, Paul Mackerras
Cc: Greg Kroah-Hartman, linuxppc-dev, Tobin C. Harding, linux-kernel
On Wed, 2019-05-15 at 09:07:50 UTC, "Tobin C. Harding" wrote:
> kfree() after kobject_put(). Who ever wrote this was on crack.
>
> Fixes: 7e8039795a80 ("powerpc/cacheinfo: Fix kobject memleak")
> Signed-off-by: Tobin C. Harding <tobin@kernel.org>
Applied to powerpc fixes, thanks.
https://git.kernel.org/powerpc/c/672eaf37db9f99fd794eed2c68a8b3b0
cheers
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2019-05-18 11:15 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-05-15 9:07 [PATCH] powerpc: Remove double free Tobin C. Harding
2019-05-15 9:26 ` Christophe Leroy
2019-05-15 11:30 ` Greg Kroah-Hartman
2019-05-18 11:15 ` Michael Ellerman
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).