[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <b1f490b450b14dd754a45f91bb1abd622ce8d4f7.1695935486.git.christophe.jaillet@wanadoo.fr>
Date: Thu, 28 Sep 2023 23:11:45 +0200
From: Christophe JAILLET <christophe.jaillet@...adoo.fr>
To: Matthew Wilcox <willy@...radead.org>,
Andrew Morton <akpm@...ux-foundation.org>,
"Liam R. Howlett" <Liam.Howlett@...cle.com>
Cc: linux-kernel@...r.kernel.org, kernel-janitors@...r.kernel.org,
Christophe JAILLET <christophe.jaillet@...adoo.fr>,
linux-fsdevel@...r.kernel.org
Subject: [PATCH] radix tree test suite: Fix a memory initialization issue
If __GFP_ZERO is used, the whole allocated memory should be cleared, not
the first part of it only.
Fixes: cc86e0c2f306 ("radix tree test suite: add support for slab bulk APIs")
Signed-off-by: Christophe JAILLET <christophe.jaillet@...adoo.fr>
---
tools/testing/radix-tree/linux.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/tools/testing/radix-tree/linux.c b/tools/testing/radix-tree/linux.c
index d587a558997f..8ab162c48629 100644
--- a/tools/testing/radix-tree/linux.c
+++ b/tools/testing/radix-tree/linux.c
@@ -172,7 +172,7 @@ int kmem_cache_alloc_bulk(struct kmem_cache *cachep, gfp_t gfp, size_t size,
if (cachep->ctor)
cachep->ctor(p[i]);
else if (gfp & __GFP_ZERO)
- memset(p[i], 0, cachep->size);
+ memset(p[i], 0, cachep->size * size);
}
}
--
2.34.1
Powered by blists - more mailing lists