diff --git a/mm/kmemleak.c b/mm/kmemleak.c index 83b6ff95d2d3..57d5ac5e7937 100755 --- a/mm/kmemleak.c +++ b/mm/kmemleak.c @@ -564,11 +564,10 @@ static struct kmemleak_object *create_object(unsigned long ptr, size_t size, struct kmemleak_object *object, *parent; struct rb_node **link, *rb_parent; - object = kmem_cache_alloc(object_cache, gfp_kmemleak_mask(gfp)); - if (!object) { - pr_warn("Cannot allocate a kmemleak_object structure\n"); - kmemleak_disable(); - return NULL; + while (1) { + object = kmem_cache_alloc(object_cache, gfp_kmemleak_mask(gfp)); + if (object) + break; } INIT_LIST_HEAD(&object->object_list);