[intel-sgx-kernel-dev,2/4] intel_sgx: Update ret val if vm_insert_pfn fails
diff mbox

Message ID 1483544024-6154-3-git-send-email-sean.j.christopherson@intel.com
State New
Headers show

Commit Message

Sean Christopherson Jan. 4, 2017, 3:33 p.m. UTC
Signed-off-by: Sean Christopherson <sean.j.christopherson@intel.com>
---
 drivers/platform/x86/intel_sgx_vma.c | 1 +
 1 file changed, 1 insertion(+)

Comments

Jarkko Sakkinen Jan. 10, 2017, 12:10 p.m. UTC | #1
On Wed, Jan 04, 2017 at 07:33:42AM -0800, Sean Christopherson wrote:
> Signed-off-by: Sean Christopherson <sean.j.christopherson@intel.com>
Reviewed-by: Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com>

/Jarkko
> ---
>  drivers/platform/x86/intel_sgx_vma.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/drivers/platform/x86/intel_sgx_vma.c b/drivers/platform/x86/intel_sgx_vma.c
> index e8a67b6..e670405 100644
> --- a/drivers/platform/x86/intel_sgx_vma.c
> +++ b/drivers/platform/x86/intel_sgx_vma.c
> @@ -255,6 +255,7 @@ static struct sgx_encl_page *sgx_vma_do_fault(struct vm_area_struct *vma,
>  
>  	if (rc) {
>  		free_flags = 0;
> +		entry = ERR_PTR(rc);
>  		goto out;
>  	}
>  
> -- 
> 2.7.4
> 
> _______________________________________________
> intel-sgx-kernel-dev mailing list
> intel-sgx-kernel-dev@lists.01.org
> https://lists.01.org/mailman/listinfo/intel-sgx-kernel-dev

Patch
diff mbox

diff --git a/drivers/platform/x86/intel_sgx_vma.c b/drivers/platform/x86/intel_sgx_vma.c
index e8a67b6..e670405 100644
--- a/drivers/platform/x86/intel_sgx_vma.c
+++ b/drivers/platform/x86/intel_sgx_vma.c
@@ -255,6 +255,7 @@  static struct sgx_encl_page *sgx_vma_do_fault(struct vm_area_struct *vma,
 
 	if (rc) {
 		free_flags = 0;
+		entry = ERR_PTR(rc);
 		goto out;
 	}