diff mbox series

[for_v31,1/6] x86/sgx: Fix inadvertant early return from sgx_ioctl()

Message ID 20200529175407.2109-2-sean.j.christopherson@intel.com (mailing list archive)
State New, archived
Headers show
Series x86/sgx: Misc fixes for v31 | expand

Commit Message

Sean Christopherson May 29, 2020, 5:54 p.m. UTC
Set 'ret' instead of returning if the enclave is dead in sgx_ioctl(),
otherwise the goto that was added doesn't take effect.

Signed-off-by: Sean Christopherson <sean.j.christopherson@intel.com>
---
 arch/x86/kernel/cpu/sgx/ioctl.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/arch/x86/kernel/cpu/sgx/ioctl.c b/arch/x86/kernel/cpu/sgx/ioctl.c
index ec5a0f017014b..2019ee1dc0b3e 100644
--- a/arch/x86/kernel/cpu/sgx/ioctl.c
+++ b/arch/x86/kernel/cpu/sgx/ioctl.c
@@ -790,7 +790,7 @@  long sgx_ioctl(struct file *filep, unsigned int cmd, unsigned long arg)
 		return -EBUSY;
 
 	if (encl_flags & SGX_ENCL_DEAD) {
-		return -EFAULT;
+		ret = -EFAULT;
 		goto out;
 	}