lkml.org 
[lkml]   [2019]   [Aug]   [13]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v3 3/3] mm: kmemleak: Use the memory pool for early allocations
On Mon, Aug 12, 2019 at 05:06:42PM +0100, Catalin Marinas wrote:
> @@ -466,9 +419,13 @@ static struct kmemleak_object *mem_pool_alloc(gfp_t gfp)
> struct kmemleak_object *object;
>
> /* try the slab allocator first */
> - object = kmem_cache_alloc(object_cache, gfp_kmemleak_mask(gfp));
> - if (object)
> - return object;
> + if (object_cache) {
> + object = kmem_cache_alloc(object_cache, gfp_kmemleak_mask(gfp));
> + if (object)
> + return object;
> + else
> + WARN_ON_ONCE(1);

Oops, this was actually my debug warning just to make sure it triggered
(tested with failslab). The WARN_ON_ONCE(1) should be removed (I changed
it locally in case I post an update).

I noticed it in Andrew's subsequent checkpatch fix.

--
Catalin

\
 
 \ /
  Last update: 2019-08-13 11:35    [W:0.131 / U:0.480 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site