mirror of
https://github.com/xen-project/xen.git
synced 2026-10-29 18:50:05 +01:00
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:
1 parent
ba61ebe1da
commit
dfecffc848
1 file changed
+3
-4
@@ -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;
|
||||
|
||||