Commit b1551515 authored by Pratyush Yadav's avatar Pratyush Yadav Committed by Andrew Morton
Browse files

kho: free chunks using free_page() instead of kfree()

Before commit fa759cd7 ("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: fa759cd7 ("kho: allocate metadata directly from the buddy allocator")
Signed-off-by: default avatarPratyush Yadav <pratyush@kernel.org>
Reviewed-by: default avatarPasha Tatashin <pasha.tatashin@soleen.com>
Reviewed-by: default avatarMike Rapoport (Microsoft) <rppt@kernel.org>
Cc: Alexander Graf <graf@amazon.com>
Cc: David Matlack <dmatlack@google.com>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
parent 724bf8c5
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -360,7 +360,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);
	}
}