]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
lib/test_kho: fixes for error handling
authorMike Rapoport (Microsoft) <rppt@kernel.org>
Mon, 11 Aug 2025 08:25:09 +0000 (11:25 +0300)
committerAndrew Morton <akpm@linux-foundation.org>
Sat, 13 Sep 2025 23:54:55 +0000 (16:54 -0700)
commit950c31e8f1280c45697e9353e2d4973ff79312bf
tree4c79427de23a8493d099a4cc6b880a3ca470f33a
parentbe564840bbc2bdd803794a7c1a3b5195a901b0d4
lib/test_kho: fixes for error handling

* Update kho_test_save() so that folios array won't be freed when
  returning from the function and the fdt will be freed on error
* Reset state->nr_folios to 0 in  kho_test_generate_data() on error
* Simplify allocation of folios info in fdt.

Link: https://lkml.kernel.org/r/20250811082510.4154080-3-rppt@kernel.org
Fixes: b753522bed0b ("kho: add test for kexec handover")
Signed-off-by: Mike Rapoport (Microsoft) <rppt@kernel.org>
Reported-by: Pratyush Yadav <pratyush@kernel.org>
Closes: https://lore.kernel.org/all/mafs0zfcjcepf.fsf@kernel.org
Reviewed-by: Pratyush Yadav <pratyush@kernel.org>
Cc: Alexander Graf <graf@amazon.com>
Cc: Baoquan He <bhe@redhat.com>
Cc: Changyuan Lyu <changyuanl@google.com>
Cc: Pasha Tatashin <pasha.tatashin@soleen.com>
Cc: Shuah Khan <shuah@kernel.org>
Cc: Thomas Weißschuh <linux@weissschuh.net>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
lib/test_kho.c