Message ID | 20161230161904.20777-2-jarkko.sakkinen@linux.intel.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
diff --git a/drivers/platform/x86/intel_sgx_vma.c b/drivers/platform/x86/intel_sgx_vma.c index c7b406b..e8a67b6 100644 --- a/drivers/platform/x86/intel_sgx_vma.c +++ b/drivers/platform/x86/intel_sgx_vma.c @@ -243,7 +243,13 @@ static struct sgx_encl_page *sgx_vma_do_fault(struct vm_area_struct *vma, goto out; } - do_eldu(encl, entry, epc_page, backing, false /* is_secs */); + rc = do_eldu(encl, entry, epc_page, backing, false /* is_secs */); + if (rc) { + sgx_put_backing(backing, 0); + entry = ERR_PTR(rc); + goto out; + } + rc = vm_insert_pfn(vma, entry->addr, PFN_DOWN(epc_page->pa)); sgx_put_backing(backing, 0);