x86/domain: make release_compat_l4 NULL tolerant

Push the check in caller down to that function so that it becomes
idempotent.

No functional change.

Signed-off-by: Wei Liu <wei.liu2@citrix.com>
Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
This commit is contained in:
Wei Liu committed 2017-06-07 12:15:56 +01:00
1 parent ba61ebe1da
commit dfecffc848
1 file changed
+3 -4
+3 -4
View File
@@ -338,7 +338,8 @@ static int setup_compat_l4(struct vcpu *v)
static void release_compat_l4(struct vcpu *v)
{
free_domheap_page(pagetable_get_page(v->arch.guest_table));
if ( !pagetable_is_null(v->arch.guest_table) )
free_domheap_page(pagetable_get_page(v->arch.guest_table));
v->arch.guest_table = pagetable_null();
v->arch.guest_table_user = pagetable_null();
}
@@ -379,9 +380,7 @@ int switch_compat(struct domain *d)
for_each_vcpu( d, v )
{
free_compat_arg_xlat(v);
if ( !pagetable_is_null(v->arch.guest_table) )
release_compat_l4(v);
release_compat_l4(v);
}
return rc;
Reference in new issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.