Skip to content

Commit a26ec8f

Browse files
soleenakpm00
authored andcommitted
lib/test_kho: check if KHO is enabled
We must check whether KHO is enabled prior to issuing KHO commands, otherwise KHO internal data structures are not initialized. Link: https://lkml.kernel.org/r/20251106220635.2608494-1-pasha.tatashin@soleen.com Fixes: b753522 ("kho: add test for kexec handover") Signed-off-by: Pasha Tatashin <pasha.tatashin@soleen.com> Reported-by: kernel test robot <oliver.sang@intel.com> Closes: https://lore.kernel.org/oe-lkp/202511061629.e242724-lkp@intel.com Reviewed-by: Pratyush Yadav <pratyush@kernel.org> Reviewed-by: Mike Rapoport (Microsoft) <rppt@kernel.org> Cc: Alexander Graf <graf@amazon.com> Cc: <stable@vger.kernel.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
1 parent f1d47ca commit a26ec8f

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

lib/test_kho.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -301,6 +301,9 @@ static int __init kho_test_init(void)
301301
phys_addr_t fdt_phys;
302302
int err;
303303

304+
if (!kho_is_enabled())
305+
return 0;
306+
304307
err = kho_retrieve_subtree(KHO_TEST_FDT, &fdt_phys);
305308
if (!err)
306309
return kho_test_restore(fdt_phys);

0 commit comments

Comments
 (0)