Skip to content

Commit

Permalink
profile: Use vzalloc() rather than vmalloc() & memset()
Browse files Browse the repository at this point in the history
There's no reason to memset() manually when we have vzalloc().

Signed-off-by: Jesper Juhl <jj@chaosbits.net>
Cc: Arjan van de Ven <arjan@infradead.org>
Cc: William Irwin <wli@holomorphy.com>
LKML-Reference: <alpine.LNX.2.00.1010302150310.1572@swampdragon.chaosbits.net>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
  • Loading branch information
Jesper Juhl authored and Ingo Molnar committed Oct 31, 2010
1 parent 3985c7c commit 559fa6e
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions kernel/profile.c
Original file line number Diff line number Diff line change
Expand Up @@ -126,11 +126,9 @@ int __ref profile_init(void)
if (prof_buffer)
return 0;

prof_buffer = vmalloc(buffer_bytes);
if (prof_buffer) {
memset(prof_buffer, 0, buffer_bytes);
prof_buffer = vzalloc(buffer_bytes);
if (prof_buffer)
return 0;
}

free_cpumask_var(prof_cpu_mask);
return -ENOMEM;
Expand Down

0 comments on commit 559fa6e

Please sign in to comment.