aboutsummaryrefslogtreecommitdiffstats
path: root/tools/testing/radix-tree/linux.c
diff options
context:
space:
mode:
Diffstat (limited to 'tools/testing/radix-tree/linux.c')
-rw-r--r--tools/testing/radix-tree/linux.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/tools/testing/radix-tree/linux.c b/tools/testing/radix-tree/linux.c
index 154823737b20..3cfb04e98e2f 100644
--- a/tools/testing/radix-tree/linux.c
+++ b/tools/testing/radix-tree/linux.c
@@ -33,7 +33,12 @@ mempool_t *mempool_create(int min_nr, mempool_alloc_t *alloc_fn,
33 33
34void *kmem_cache_alloc(struct kmem_cache *cachep, int flags) 34void *kmem_cache_alloc(struct kmem_cache *cachep, int flags)
35{ 35{
36 void *ret = malloc(cachep->size); 36 void *ret;
37
38 if (flags & __GFP_NOWARN)
39 return NULL;
40
41 ret = malloc(cachep->size);
37 if (cachep->ctor) 42 if (cachep->ctor)
38 cachep->ctor(ret); 43 cachep->ctor(ret);
39 uatomic_inc(&nr_allocated); 44 uatomic_inc(&nr_allocated);