]> git.kernelconcepts.de Git - karo-tx-linux.git/blobdiff - tools/testing/radix-tree/linux.c
radix tree test suite: allow GFP_ATOMIC allocations to fail
[karo-tx-linux.git] / tools / testing / radix-tree / linux.c
index 154823737b20d35f90d0b2e8e4b60f99795d81e0..3cfb04e98e2f3eaea845fc25bc7aa132ee52f945 100644 (file)
@@ -33,7 +33,12 @@ mempool_t *mempool_create(int min_nr, mempool_alloc_t *alloc_fn,
 
 void *kmem_cache_alloc(struct kmem_cache *cachep, int flags)
 {
-       void *ret = malloc(cachep->size);
+       void *ret;
+
+       if (flags & __GFP_NOWARN)
+               return NULL;
+
+       ret = malloc(cachep->size);
        if (cachep->ctor)
                cachep->ctor(ret);
        uatomic_inc(&nr_allocated);