diff mbox series

[for_v29,5/8] selftests/x86: sgx: Zero out @result before invoking vDSO sub-test

Message ID 20200319011130.8556-6-sean.j.christopherson@intel.com (mailing list archive)
State New, archived
Headers show
Series x86/sgx: Make vDSO callable from C | expand

Commit Message

Sean Christopherson March 19, 2020, 1:11 a.m. UTC
Zero out @result before running the vDSO sub-test, otherwise the vDSO
could fail completely and the selftest would be none the wiser, e.g. it
doesn't explicitly check the return value.

Signed-off-by: Sean Christopherson <sean.j.christopherson@intel.com>
---
 tools/testing/selftests/x86/sgx/main.c | 1 +
 1 file changed, 1 insertion(+)
diff mbox series

Patch

diff --git a/tools/testing/selftests/x86/sgx/main.c b/tools/testing/selftests/x86/sgx/main.c
index d97cc3cf0093..c9c37d2bbec8 100644
--- a/tools/testing/selftests/x86/sgx/main.c
+++ b/tools/testing/selftests/x86/sgx/main.c
@@ -366,6 +366,7 @@  int main(int argc, char *argv[], char *envp[])
 
 	printf("Input: 0x%lx\n", MAGIC);
 
+	result = 0;
 	sgx_call_vdso((void *)&MAGIC, &result, 0, NULL, NULL, NULL,
 		      (void *)secs.base, &exception, NULL);
 	if (result != MAGIC) {