Message ID | 20191221003156.27236-2-sean.j.christopherson@intel.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
Series | x86/sgx: Reclaim bug fix and cleanup | expand |
diff --git a/arch/x86/kernel/cpu/sgx/reclaim.c b/arch/x86/kernel/cpu/sgx/reclaim.c index 21fbfe2ed9c4..67bda5528625 100644 --- a/arch/x86/kernel/cpu/sgx/reclaim.c +++ b/arch/x86/kernel/cpu/sgx/reclaim.c @@ -361,9 +361,9 @@ static void sgx_reclaimer_write(struct sgx_epc_page *epc_page, sgx_free_page(encl->secs.epc_page); encl->secs.epc_page = NULL; + + sgx_encl_put_backing(&secs_backing, true); } - - sgx_encl_put_backing(&secs_backing, true); } }
Put the SECS backing if and only if retrieving the backing succeeded, otherwise sgx_encl_put_backing() will consume uninitialized pointers. Signed-off-by: Sean Christopherson <sean.j.christopherson@intel.com> --- arch/x86/kernel/cpu/sgx/reclaim.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)