diff mbox series

[for_v21] x86/sgx: Return error from driver init if launch control isn't supported

Message ID 20190712041255.29219-1-sean.j.christopherson@intel.com (mailing list archive)
State New, archived
Headers show
Series [for_v21] x86/sgx: Return error from driver init if launch control isn't supported | expand

Commit Message

Sean Christopherson July 12, 2019, 4:12 a.m. UTC
Return an error when the driver fails to load, otherwise the core SGX
code will unnecessarily consume resources, e.g. tracking EPC and running
its kthread.

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

Patch

diff --git a/arch/x86/kernel/cpu/sgx/driver/main.c b/arch/x86/kernel/cpu/sgx/driver/main.c
index 2d1943c13879..f4a2ef26fcbf 100644
--- a/arch/x86/kernel/cpu/sgx/driver/main.c
+++ b/arch/x86/kernel/cpu/sgx/driver/main.c
@@ -195,7 +195,7 @@  int sgx_drv_init(void)
 
 	if (!boot_cpu_has(X86_FEATURE_SGX_LC)) {
 		pr_info("sgx: The public key MSRs are not writable\n");
-		return 0;
+		return -ENODEV;
 	}
 
 	ret = bus_register(&sgx_bus_type);