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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxx>
---
 tools/testing/selftests/x86/sgx/main.c | 1 +
 1 file changed, 1 insertion(+)

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) {
-- 
2.24.1




[Index of Archives]     [AMD Graphics]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux