Skip to content

Commit

Permalink
x86: debug Store - call kfree if only we really need it
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Cyrill Gorcunov authored and Ingo Molnar committed Apr 17, 2008
1 parent 19b4e7f commit 431ef7a
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions arch/x86/kernel/ds.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down

0 comments on commit 431ef7a

Please sign in to comment.