[PATCH] lib: test_rhashtable: Fix KASAN warning

Subsystems: library code, rhashtable, the rest

STALE3340d

2 messages, 2 authors, 2017-07-25 · open the first message on its own page

[PATCH] lib: test_rhashtable: Fix KASAN warning

From: Phil Sutter <phil@nwl.cc>
Date: 2017-07-25 11:36:33

I forgot one spot when introducing struct test_obj_val.

Fixes: e859afe1ee0c5 ("lib: test_rhashtable: fix for large entry counts")
Reported by: kernel test robot [off-list ref]

Signed-off-by: Phil Sutter <phil@nwl.cc>
---
 lib/test_rhashtable.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/lib/test_rhashtable.c b/lib/test_rhashtable.c
index 16949d219291a..0ffca990a8337 100644
--- a/lib/test_rhashtable.c
+++ b/lib/test_rhashtable.c
@@ -223,7 +223,9 @@ static s64 __init test_rhashtable(struct rhashtable *ht)
 
 	pr_info("  Deleting %d keys\n", entries);
 	for (i = 0; i < entries; i++) {
-		u32 key = i * 2;
+		struct test_obj_val key = {
+			.id = i * 2,
+		};
 
 		if (array[i].value.id != TEST_INSERT_FAIL) {
 			obj = rhashtable_lookup_fast(ht, &key, test_rht_params);
-- 
2.13.1

Re: [PATCH] lib: test_rhashtable: Fix KASAN warning

From: David Miller <davem@davemloft.net>
Date: 2017-07-25 19:36:08

From: Phil Sutter <phil@nwl.cc>
Date: Tue, 25 Jul 2017 13:36:21 +0200
I forgot one spot when introducing struct test_obj_val.

Fixes: e859afe1ee0c5 ("lib: test_rhashtable: fix for large entry counts")
Reported by: kernel test robot [off-list ref]

Signed-off-by: Phil Sutter <phil@nwl.cc>
Please don't put empty lines in the middle of a set of tags like that.
I fixed it up this time :)

Applied, thanks.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help