Lines Matching refs:buf
66 void *buf; in do_alloc_pages_order() local
70 buf = page_address(page); in do_alloc_pages_order()
71 fill_with_garbage(buf, size); in do_alloc_pages_order()
75 buf = page_address(page); in do_alloc_pages_order()
76 if (count_nonzero_bytes(buf, size)) in do_alloc_pages_order()
78 fill_with_garbage(buf, size); in do_alloc_pages_order()
100 void *buf; in do_kmalloc_size() local
102 buf = kmalloc(size, GFP_KERNEL); in do_kmalloc_size()
103 fill_with_garbage(buf, size); in do_kmalloc_size()
104 kfree(buf); in do_kmalloc_size()
106 buf = kmalloc(size, GFP_KERNEL); in do_kmalloc_size()
107 if (count_nonzero_bytes(buf, size)) in do_kmalloc_size()
109 fill_with_garbage(buf, size); in do_kmalloc_size()
110 kfree(buf); in do_kmalloc_size()
117 void *buf; in do_vmalloc_size() local
119 buf = vmalloc(size); in do_vmalloc_size()
120 fill_with_garbage(buf, size); in do_vmalloc_size()
121 vfree(buf); in do_vmalloc_size()
123 buf = vmalloc(size); in do_vmalloc_size()
124 if (count_nonzero_bytes(buf, size)) in do_vmalloc_size()
126 fill_with_garbage(buf, size); in do_vmalloc_size()
127 vfree(buf); in do_vmalloc_size()
166 static bool __init check_buf(void *buf, int size, bool want_ctor, in check_buf() argument
172 bytes = count_nonzero_bytes(buf, size); in check_buf()
177 if (*(unsigned int *)buf != CTOR_PATTERN) in check_buf()
200 void *buf, *buf_copy; in do_kmem_cache_size() local
206 buf = kmem_cache_alloc(c, alloc_mask); in do_kmem_cache_size()
208 fail = check_buf(buf, size, want_ctor, want_rcu, want_zero); in do_kmem_cache_size()
209 fill_with_garbage_skip(buf, size, want_ctor ? CTOR_BYTES : 0); in do_kmem_cache_size()
212 kmem_cache_free(c, buf); in do_kmem_cache_size()
227 memcpy(buf_copy, buf, size); in do_kmem_cache_size()
229 kmem_cache_free(c, buf); in do_kmem_cache_size()
235 fail |= check_buf(buf, size, want_ctor, want_rcu, in do_kmem_cache_size()
238 fail |= (bool)memcmp(buf, buf_copy, size); in do_kmem_cache_size()
256 void *buf, *buf_contents, *saved_ptr; in do_kmem_cache_rcu_persistent() local
263 buf = kmem_cache_alloc(c, GFP_KERNEL); in do_kmem_cache_rcu_persistent()
264 saved_ptr = buf; in do_kmem_cache_rcu_persistent()
265 fill_with_garbage(buf, size); in do_kmem_cache_rcu_persistent()
274 memcpy(buf_contents, buf, size); in do_kmem_cache_rcu_persistent()
275 kmem_cache_free(c, buf); in do_kmem_cache_rcu_persistent()
281 buf = kmem_cache_alloc(c, GFP_KERNEL); in do_kmem_cache_rcu_persistent()
282 used_objects[iter] = buf; in do_kmem_cache_rcu_persistent()
283 if (buf == saved_ptr) { in do_kmem_cache_rcu_persistent()
284 fail = memcmp(buf_contents, buf, size); in do_kmem_cache_rcu_persistent()