Skip to content

Commit 559fa6e

Browse files
jjuhlIngo Molnar
authored andcommitted
profile: Use vzalloc() rather than vmalloc() & memset()
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>
1 parent 3985c7c commit 559fa6e

1 file changed

Lines changed: 2 additions & 4 deletions

File tree

‎kernel/profile.c‎

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -126,11 +126,9 @@ int __ref profile_init(void)
126126
if (prof_buffer)
127127
return 0;
128128

129-
prof_buffer = vmalloc(buffer_bytes);
130-
if (prof_buffer) {
131-
memset(prof_buffer, 0, buffer_bytes);
129+
prof_buffer = vzalloc(buffer_bytes);
130+
if (prof_buffer)
132131
return 0;
133-
}
134132

135133
free_cpumask_var(prof_cpu_mask);
136134
return -ENOMEM;

0 commit comments

Comments
 (0)