Lines Matching refs:buf
66 void *buf; in do_alloc_pages_order() local
72 buf = page_address(page); in do_alloc_pages_order()
73 fill_with_garbage(buf, size); in do_alloc_pages_order()
79 buf = page_address(page); in do_alloc_pages_order()
80 if (count_nonzero_bytes(buf, size)) in do_alloc_pages_order()
82 fill_with_garbage(buf, size); in do_alloc_pages_order()
107 void *buf; in do_kmalloc_size() local
109 buf = kmalloc(size, GFP_KERNEL); in do_kmalloc_size()
110 if (!buf) in do_kmalloc_size()
112 fill_with_garbage(buf, size); in do_kmalloc_size()
113 kfree(buf); in do_kmalloc_size()
115 buf = kmalloc(size, GFP_KERNEL); in do_kmalloc_size()
116 if (!buf) in do_kmalloc_size()
118 if (count_nonzero_bytes(buf, size)) in do_kmalloc_size()
120 fill_with_garbage(buf, size); in do_kmalloc_size()
121 kfree(buf); in do_kmalloc_size()
131 void *buf; in do_vmalloc_size() local
133 buf = vmalloc(size); in do_vmalloc_size()
134 if (!buf) in do_vmalloc_size()
136 fill_with_garbage(buf, size); in do_vmalloc_size()
137 vfree(buf); in do_vmalloc_size()
139 buf = vmalloc(size); in do_vmalloc_size()
140 if (!buf) in do_vmalloc_size()
142 if (count_nonzero_bytes(buf, size)) in do_vmalloc_size()
144 fill_with_garbage(buf, size); in do_vmalloc_size()
145 vfree(buf); in do_vmalloc_size()
187 static bool __init check_buf(void *buf, int size, bool want_ctor, in check_buf() argument
193 bytes = count_nonzero_bytes(buf, size); in check_buf()
198 if (*(unsigned int *)buf != CTOR_PATTERN) in check_buf()
224 void *buf, *buf_copy; in do_kmem_cache_size() local
245 buf = kmem_cache_alloc(c, alloc_mask); in do_kmem_cache_size()
247 fail |= check_buf(buf, size, want_ctor, want_rcu, want_zero); in do_kmem_cache_size()
248 fill_with_garbage_skip(buf, size, want_ctor ? CTOR_BYTES : 0); in do_kmem_cache_size()
251 kmem_cache_free(c, buf); in do_kmem_cache_size()
266 memcpy(buf_copy, buf, size); in do_kmem_cache_size()
268 kmem_cache_free(c, buf); in do_kmem_cache_size()
274 fail |= check_buf(buf, size, want_ctor, want_rcu, in do_kmem_cache_size()
277 fail |= (bool)memcmp(buf, buf_copy, size); in do_kmem_cache_size()
295 void *buf, *buf_contents, *saved_ptr; in do_kmem_cache_rcu_persistent() local
302 buf = kmem_cache_alloc(c, GFP_KERNEL); in do_kmem_cache_rcu_persistent()
303 if (!buf) in do_kmem_cache_rcu_persistent()
305 saved_ptr = buf; in do_kmem_cache_rcu_persistent()
306 fill_with_garbage(buf, size); in do_kmem_cache_rcu_persistent()
309 kmem_cache_free(c, buf); in do_kmem_cache_rcu_persistent()
314 kmem_cache_free(c, buf); in do_kmem_cache_rcu_persistent()
318 memcpy(buf_contents, buf, size); in do_kmem_cache_rcu_persistent()
319 kmem_cache_free(c, buf); in do_kmem_cache_rcu_persistent()
325 buf = kmem_cache_alloc(c, GFP_KERNEL); in do_kmem_cache_rcu_persistent()
326 used_objects[iter] = buf; in do_kmem_cache_rcu_persistent()
327 if (buf == saved_ptr) { in do_kmem_cache_rcu_persistent()
328 fail = memcmp(buf_contents, buf, size); in do_kmem_cache_rcu_persistent()