x86: debug Store - call kfree if only we really need it
authorCyrill Gorcunov <gorcunov@gmail.com>
Tue, 1 Apr 2008 15:41:50 +0000 (19:41 +0400)
committerIngo Molnar <mingo@elte.hu>
Thu, 17 Apr 2008 15:41:34 +0000 (17:41 +0200)
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>
arch/x86/kernel/ds.c

index dcd918c1580dfda5dc66c50d3d9d3492dde6fcee..11c11b8ec48dd59f1494c2051433dd8f6f2a7777 100644 (file)
@@ -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;
 }