Skip to contentSkip to conversation

kfence: fix typo in test

PATCH In review Marco Elver 2 participants 3 messages Dec 15, 2020 – Dec 17, 2020

Subsystems (2)
lore
Share & tools
lore

Marco Elver

author maintainer
#0 lore raw

PATCH 1/1 kfence: fix typo in test

Fix a typo/accidental copy-paste that resulted in the obviously incorrect 'GFP_KERNEL * 2' expression.

---
 mm/kfence/kfence_test.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
mm/kfence/kfence_test.c +1 -1
index 1433a35a1644..f57c61c833e6 100644
@@ -665,7 +665,7 @@ static void test_krealloc(struct kunit *test)
 	for (; i < size * 3; i++) /* Fill to extra bytes. */
 		buf[i] = i + 1;
 
-	buf = krealloc(buf, size * 2, GFP_KERNEL * 2); /* Shrink. */
+	buf = krealloc(buf, size * 2, GFP_KERNEL); /* Shrink. */
 	KUNIT_EXPECT_GE(test, ksize(buf), size * 2);
 	for (i = 0; i < size * 2; i++)
 		KUNIT_EXPECT_EQ(test, buf[i], (char)(i + 1));
Signature · 1 line
2.29.2.684.gfbc64c5ab5-goog
author maintainer
#1 lore raw
Quoted 23 lines · Marco Elver

Fix a typo/accidental copy-paste that resulted in the obviously incorrect 'GFP_KERNEL * 2' expression.

---
 mm/kfence/kfence_test.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
mm/kfence/kfence_test.c +1 -2
index 1433a35a1644..f57c61c833e6 100644
@@ -665,7 +665,7 @@ static void test_krealloc(struct kunit *test)
        for (; i < size * 3; i++) /* Fill to extra bytes. */
                buf[i] = i + 1;
 
-       buf = krealloc(buf, size * 2, GFP_KERNEL * 2); /* Shrink. */
+       buf = krealloc(buf, size * 2, GFP_KERNEL); /* Shrink. */
        KUNIT_EXPECT_GE(test, ksize(buf), size * 2);
        for (i = 0; i < size * 2; i++)
                KUNIT_EXPECT_EQ(test, buf[i], (char)(i + 1));
--
Quoted 2 lines

2.29.2.684.gfbc64c5ab5-goog

This patch could, if appropriate, be squashed into "kfence: add test suite".

Thanks,
-- Marco

maintainer Acked-by
#2 lore raw
Quoted 7 lines · Marco Elver
Quoted 5 lines · Marco Elver

Fix a typo/accidental copy-paste that resulted in the obviously incorrect 'GFP_KERNEL * 2' expression.

Quoted 25 lines
Quoted 18 lines
---
 mm/kfence/kfence_test.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
mm/kfence/kfence_test.c +1 -2
index 1433a35a1644..f57c61c833e6 100644
@@ -665,7 +665,7 @@ static void test_krealloc(struct kunit *test)
        for (; i < size * 3; i++) /* Fill to extra bytes. */
                buf[i] = i + 1;
 
-       buf = krealloc(buf, size * 2, GFP_KERNEL * 2); /* Shrink. */
+       buf = krealloc(buf, size * 2, GFP_KERNEL); /* Shrink. */
        KUNIT_EXPECT_GE(test, ksize(buf), size * 2);
        for (i = 0; i < size * 2; i++)
                KUNIT_EXPECT_EQ(test, buf[i], (char)(i + 1));
--
Quoted 2 lines

2.29.2.684.gfbc64c5ab5-goog

This patch could, if appropriate, be squashed into "kfence: add test suite".

Thanks,
-- Marco

Signature · 10 lines
Alexander Potapenko
Software Engineer

Google Germany GmbH
Erika-Mann-Straße, 33
80636 München

Geschäftsführer: Paul Manicle, Halimah DeLaine Prado
Registergericht und -nummer: Hamburg, HRB 86891
Sitz der Gesellschaft: Hamburg