Commit 2db703fc authored by Reinette Chatre's avatar Reinette Chatre Committed by Dave Hansen

selftests/sgx: Ensure enclave data available during debug print

In support of debugging the SGX tests print details from
the enclave and its memory mappings if any failure is encountered
during enclave loading.

When a failure is encountered no data is printed because the
printing of the data is preceded by cleanup of the data.

Move the data cleanup after the data print.

Fixes: 14717214 ("selftests/sgx: Dump segments and /proc/self/maps only on failure")
Signed-off-by: default avatarReinette Chatre <reinette.chatre@intel.com>
Signed-off-by: default avatarDave Hansen <dave.hansen@linux.intel.com>
Acked-by: default avatarShuah Khan <skhan@linuxfoundation.org>
Link: https://lkml.kernel.org/r/dab672f771e9b99e50c17ae2a75dc0b020cb0ce9.1644355600.git.reinette.chatre@intel.com
parent fff36bcb
......@@ -186,8 +186,6 @@ static bool setup_test_encl(unsigned long heap_size, struct encl *encl,
return true;
err:
encl_delete(encl);
for (i = 0; i < encl->nr_segments; i++) {
seg = &encl->segment_tbl[i];
......@@ -208,6 +206,8 @@ static bool setup_test_encl(unsigned long heap_size, struct encl *encl,
TH_LOG("Failed to initialize the test enclave.\n");
encl_delete(encl);
return false;
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment