From ba332e0e5557955a2a65638cd98e1b18005b639c Mon Sep 17 00:00:00 2001 From: Michael Shaw Date: Thu, 11 May 2023 12:54:31 -0400 Subject: [PATCH] main: cleanup kmalloc test --- init/main.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/init/main.c b/init/main.c index 39db39a..4fd5ea4 100644 --- a/init/main.c +++ b/init/main.c @@ -106,12 +106,13 @@ static void kmalloc_init_test() void *a = kmalloc(0x1000, ALLOC_KERN); kfree(a); void *b = kmalloc(0x1000, ALLOC_KERN); - kfree(b); if (a != b) { printf(LOG_DEBUG "kmalloc consistency test failed\n"); } else { printf(LOG_DEBUG "kmalloc consistency test passed\n"); } + + kfree(b); } #endif /* KDEBUG */