From: Cyrill Gorcunov Date: Tue, 1 Apr 2008 15:41:50 +0000 (+0400) Subject: x86: debug Store - call kfree if only we really need it X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=431ef7a2a486201967304fcc9cfc33e945626fed;p=mv-sheeva.git 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 Signed-off-by: Ingo Molnar --- diff --git a/arch/x86/kernel/ds.c b/arch/x86/kernel/ds.c index dcd918c1580..11c11b8ec48 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; }