Skip to content

Commit 2db703f

Browse files
rchatrehansendc
authored andcommitted
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: 1471721 ("selftests/sgx: Dump segments and /proc/self/maps only on failure") Signed-off-by: Reinette Chatre <reinette.chatre@intel.com> Signed-off-by: Dave Hansen <dave.hansen@linux.intel.com> Acked-by: Shuah Khan <skhan@linuxfoundation.org> Link: https://lkml.kernel.org/r/dab672f771e9b99e50c17ae2a75dc0b020cb0ce9.1644355600.git.reinette.chatre@intel.com
1 parent fff36bc commit 2db703f

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

  • tools/testing/selftests/sgx

tools/testing/selftests/sgx/main.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -186,8 +186,6 @@ static bool setup_test_encl(unsigned long heap_size, struct encl *encl,
186186
return true;
187187

188188
err:
189-
encl_delete(encl);
190-
191189
for (i = 0; i < encl->nr_segments; i++) {
192190
seg = &encl->segment_tbl[i];
193191

@@ -208,6 +206,8 @@ static bool setup_test_encl(unsigned long heap_size, struct encl *encl,
208206

209207
TH_LOG("Failed to initialize the test enclave.\n");
210208

209+
encl_delete(encl);
210+
211211
return false;
212212
}
213213

0 commit comments

Comments
 (0)