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-Tag: v2.6.26-rc1~1154^2~45 X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=431ef7a2a486201967304fcc9cfc33e945626fed;p=linux-2.6 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 dcd918c158..11c11b8ec4 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; }