x86/p2m: fix p2m_finish_type_change()
authorRazvan Cojocaru <rcojocaru@bitdefender.com>
Fri, 11 Jan 2019 11:28:49 +0000 (12:28 +0100)
committerJan Beulich <jbeulich@suse.com>
Fri, 11 Jan 2019 11:28:49 +0000 (12:28 +0100)
commit2bad3829a59a9b227ab652d9e152cfb361b5f62c
treec1e052b1126ad0ea9c3f6ea36fd02b3746c0ea9f
parent808cff4c2af66afd61973451aeb7e708732abf90
x86/p2m: fix p2m_finish_type_change()

finish_type_change() returns a negative int on error, but the
current code checks if ( !rc ). We also need to treat
finish_type_change()'s return codes cumulatively in the
success case (don't overwrite a 1 returned while processing
the hostp2m if processing an altp2m returns 0).

The breakage was introduced by commit 0fb4b58c8b
("x86/altp2m: fix display frozen when switching to a new view
early").

Properly indent the out: label while at it.

Signed-off-by: Razvan Cojocaru <rcojocaru@bitdefender.com>
Reviewed-by: Jan Beulich <jbeulich@suse.com>
Acked-by: George Dunlap <george.dunlap@citrix.com>
xen/arch/x86/mm/p2m.c