From: Federico Parola <fparola@amazon.de>
To: <stable@vger.kernel.org>
Cc: Mike Rapoport <rppt@kernel.org>,
Pasha Tatashin <pasha.tatashin@soleen.com>,
Pratyush Yadav <pratyush@kernel.org>,
"Alexander Graf" <graf@amazon.com>,
Andrew Morton <akpm@linux-foundation.org>,
<kexec@lists.infradead.org>, <linux-mm@kvack.org>,
<nh-open-source@amazon.com>
Subject: [PATCH 6.18.y 1/2] kho: free chunks using free_page() instead of kfree()
Date: Thu, 15 Oct 2026 14:45:28 +0000 [thread overview]
Message-ID: <20261015144529.76911-2-fparola@amazon.de> (raw)
In-Reply-To: <20261015144529.76911-1-fparola@amazon.de>
From: Pratyush Yadav <pratyush@kernel.org>
[ Upstream commit b15515155af735a86e5bcd67ed739162f0de27f5 ]
Before commit fa759cd75bce5 ("kho: allocate metadata directly from the
buddy allocator"), the chunks were allocated from the slab allocator using
kzalloc(). Those were rightly freed using kfree().
When the commit switched to using the buddy allocator directly, it missed
updating kho_mem_ser_free() to use free_page() instead of kfree().
Link: https://lkml.kernel.org/r/20251118182218.63044-1-pratyush@kernel.org
Fixes: fa759cd75bce5 ("kho: allocate metadata directly from the buddy allocator")
Signed-off-by: Pratyush Yadav <pratyush@kernel.org>
Reviewed-by: Pasha Tatashin <pasha.tatashin@soleen.com>
Reviewed-by: Mike Rapoport (Microsoft) <rppt@kernel.org>
Cc: Alexander Graf <graf@amazon.com>
Cc: David Matlack <dmatlack@google.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Federico Parola <fparola@amazon.de>
---
kernel/kexec_handover.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/kernel/kexec_handover.c b/kernel/kexec_handover.c
index ac9fa7727b5ff..9fe5d14f1ec54 100644
--- a/kernel/kexec_handover.c
+++ b/kernel/kexec_handover.c
@@ -365,7 +365,7 @@ static void kho_mem_ser_free(struct khoser_mem_chunk *first_chunk)
struct khoser_mem_chunk *tmp = chunk;
chunk = KHOSER_LOAD_PTR(chunk->hdr.next);
- kfree(tmp);
+ free_page((unsigned long)tmp);
}
}
--
2.47.3
next prev parent reply other threads:[~2026-10-15 14:45 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-15 14:45 [PATCH 6.18.y 0/2] kho: free buddy-allocated metadata with free_page() Federico Parola
2026-10-15 14:45 ` Federico Parola [this message]
2026-10-15 14:45 ` [PATCH 6.18.y 2/2] kho: free phys_bits bitmaps using free_page() in __kho_abort() Federico Parola
2026-10-17 3:00 ` Sasha Levin
2026-10-18 4:31 ` Mike Rapoport
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20261015144529.76911-2-fparola@amazon.de \
--to=fparola@amazon.de \
--cc=akpm@linux-foundation.org \
--cc=graf@amazon.com \
--cc=kexec@lists.infradead.org \
--cc=linux-mm@kvack.org \
--cc=nh-open-source@amazon.com \
--cc=pasha.tatashin@soleen.com \
--cc=pratyush@kernel.org \
--cc=rppt@kernel.org \
--cc=stable@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox