Commit a26ec8f3 authored by Pasha Tatashin's avatar Pasha Tatashin Committed by Andrew Morton
Browse files

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: b753522b ("kho: add test for kexec handover")
Signed-off-by: default avatarPasha Tatashin <pasha.tatashin@soleen.com>
Reported-by: default avatarkernel test robot <oliver.sang@intel.com>
Closes: https://lore.kernel.org/oe-lkp/202511061629.e242724-lkp@intel.com


Reviewed-by: default avatarPratyush Yadav <pratyush@kernel.org>
Reviewed-by: default avatarMike Rapoport (Microsoft) <rppt@kernel.org>
Cc: Alexander Graf <graf@amazon.com>
Cc: <stable@vger.kernel.org>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
parent f1d47caf
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -301,6 +301,9 @@ static int __init kho_test_init(void)
	phys_addr_t fdt_phys;
	int err;

	if (!kho_is_enabled())
		return 0;

	err = kho_retrieve_subtree(KHO_TEST_FDT, &fdt_phys);
	if (!err)
		return kho_test_restore(fdt_phys);