diff options
| author | Long Wei <longwei27@huawei.com> | 2026-01-07 10:24:27 +0800 |
|---|---|---|
| committer | Andrew Morton <akpm@linux-foundation.org> | 2026-01-26 19:07:13 -0800 |
| commit | 77ce1b4cd08fcdd049001fdf5f59c014fb4b7711 (patch) | |
| tree | f522068657a8bf9a5b5b3dc36ee4b67b957afb8a /lib | |
| parent | bf45794244ca1fb1c135754f36ff765eea01f9e6 (diff) | |
kho: test: clean up residual memory upon test_kho module unload
During the initialization phase, the test_kho module invokes the
kho_preserve_folio function, which internally configures bitmaps within
kho_mem_track and establishes chunk linked lists in KHO. Upon unloading
the test_kho module, it is necessary to clean up these states.
Link: https://lkml.kernel.org/r/20260107022427.4114424-1-longwei27@huawei.com
Signed-off-by: Long Wei <longwei27@huawei.com>
Acked-by: Mike Rapoport (Microsoft) <rppt@kernel.org>
Cc: Alexander Graf <graf@amazon.com>
Cc: hewenliang <hewenliang4@huawei.com>
Cc: Pasha Tatashin <pasha.tatashin@soleen.com>
Cc: Pratyush Yadav <pratyush@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Diffstat (limited to 'lib')
| -rw-r--r-- | lib/test_kho.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/test_kho.c b/lib/test_kho.c index 3431daca6968..a20fafaf9846 100644 --- a/lib/test_kho.c +++ b/lib/test_kho.c @@ -340,11 +340,15 @@ module_init(kho_test_init); static void kho_test_cleanup(void) { + /* unpreserve and free the data stored in folios */ + kho_test_unpreserve_data(&kho_test_state); for (int i = 0; i < kho_test_state.nr_folios; i++) folio_put(kho_test_state.folios[i]); kvfree(kho_test_state.folios); - vfree(kho_test_state.folios_info); + + /* Unpreserve and release the FDT folio */ + kho_unpreserve_folio(kho_test_state.fdt); folio_put(kho_test_state.fdt); } |
