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

Message ID 20200529175407.2109-2-sean.j.christopherson@intel.com
State New
Headers show
Series
  • x86/sgx: Misc fixes for v31
Related show

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(-)

Patch
diff mbox series

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;
 	}