* [PATCH] x86: Debug Store - call kfree if only we really need it
@ 2008-04-01 15:41 Cyrill Gorcunov
2008-04-04 8:13 ` Ingo Molnar
0 siblings, 1 reply; 2+ messages in thread
From: Cyrill Gorcunov @ 2008-04-01 15:41 UTC (permalink / raw)
To: Ingo Molnar, Markus Metzger; +Cc: H. Peter Anvin, LKML
We should call for kfree if only we really need it.
Though it's safe to call kfree with NULL pointer passed
in this code we've already tested the pointer and can
eliminate the call
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
---
ds.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
Index: linux-2.6.git/arch/x86/kernel/ds.c
===================================================================
--- linux-2.6.git.orig/arch/x86/kernel/ds.c 2008-03-30 15:05:50.000000000 +0400
+++ linux-2.6.git/arch/x86/kernel/ds.c 2008-04-01 19:20:20.000000000 +0400
@@ -220,11 +220,11 @@ int ds_allocate(void **dsp, size_t bts_s
int ds_free(void **dsp)
{
- if (*dsp)
+ if (*dsp) {
kfree((void *)get_bts_buffer_base(*dsp));
- kfree(*dsp);
- *dsp = NULL;
-
+ kfree(*dsp);
+ *dsp = NULL;
+ }
return 0;
}
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH] x86: Debug Store - call kfree if only we really need it
2008-04-01 15:41 [PATCH] x86: Debug Store - call kfree if only we really need it Cyrill Gorcunov
@ 2008-04-04 8:13 ` Ingo Molnar
0 siblings, 0 replies; 2+ messages in thread
From: Ingo Molnar @ 2008-04-04 8:13 UTC (permalink / raw)
To: Cyrill Gorcunov; +Cc: Markus Metzger, H. Peter Anvin, LKML
* Cyrill Gorcunov <gorcunov@gmail.com> wrote:
> We should call for kfree if only we really need it. Though it's safe
> to call kfree with NULL pointer passed in this code we've already
> tested the pointer and can eliminate the call
thanks, applied.
Ingo
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2008-04-04 8:14 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-04-01 15:41 [PATCH] x86: Debug Store - call kfree if only we really need it Cyrill Gorcunov
2008-04-04 8:13 ` Ingo Molnar
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox