summaryrefslogtreecommitdiff
path: root/arch
diff options
context:
space:
mode:
authorCyrill Gorcunov <gorcunov@gmail.com>2008-04-01 19:41:50 +0400
committerIngo Molnar <mingo@elte.hu>2008-04-17 19:41:34 +0400
commit431ef7a2a486201967304fcc9cfc33e945626fed (patch)
tree92181215fe9d9d00e949edd1d0ef654d6301f279 /arch
parent19b4e7f4e9b1c88459cf2c9b9ccaa09cb8bf854d (diff)
downloadlinux-431ef7a2a486201967304fcc9cfc33e945626fed.tar.xz
x86: debug Store - call kfree if only we really need it
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> Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'arch')
-rw-r--r--arch/x86/kernel/ds.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/arch/x86/kernel/ds.c b/arch/x86/kernel/ds.c
index dcd918c1580d..11c11b8ec48d 100644
--- a/arch/x86/kernel/ds.c
+++ b/arch/x86/kernel/ds.c
@@ -220,11 +220,11 @@ int ds_allocate(void **dsp, size_t bts_size_in_bytes)
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;
}