diff options
author | Andrew Cooper <andrew.cooper3@citrix.com> | 2013-10-09 12:11:48 +0200 |
---|---|---|
committer | Jan Beulich <jbeulich@suse.com> | 2013-10-09 12:11:48 +0200 |
commit | c56cdf93750fd978aebd69dc113f12cc770ff8e3 (patch) | |
tree | 92104e99e9f635b4fdffe57e96d65533f57c2a04 /xen/arch/x86/hvm/viridian.c | |
parent | 839b966e3f587bbb1a0d954230fb3904330dccb6 (diff) | |
download | xen-c56cdf93750fd978aebd69dc113f12cc770ff8e3.tar.gz xen-c56cdf93750fd978aebd69dc113f12cc770ff8e3.tar.bz2 xen-c56cdf93750fd978aebd69dc113f12cc770ff8e3.zip |
hvm/vidirian: Avoid printing page_to_mfn(NULL) on error paths
While working in the viridian code, I noticed that 4cb6c4f4941
"x86/hvm: Use get_page_from_gfn() instead of get_gfn()/put_gfn."
introduced two error paths where page_to_mfn(NULL) would be formatted and
presented as a bad MFN. This provides junk in the warning rather than
something useful.
These two codepaths are fixed up to match their counterpart in
wrmsr_hypervisor_regs()
While auditing the other changes from 4cb6c4f4941, I noticed a small
optimisation which could be made by changing the order of the validity checks
to remove 6 NULL pointer checks.
Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
Acked-by: Keir Fraser <keir@xen.org>
Diffstat (limited to 'xen/arch/x86/hvm/viridian.c')
-rw-r--r-- | xen/arch/x86/hvm/viridian.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/xen/arch/x86/hvm/viridian.c b/xen/arch/x86/hvm/viridian.c index d5462f2aae..a6721c3eb0 100644 --- a/xen/arch/x86/hvm/viridian.c +++ b/xen/arch/x86/hvm/viridian.c @@ -157,7 +157,7 @@ static void enable_hypercall_page(struct domain *d) if ( page ) put_page(page); gdprintk(XENLOG_WARNING, "Bad GMFN %lx (MFN %lx)\n", gmfn, - page_to_mfn(page)); + page ? page_to_mfn(page) : INVALID_MFN); return; } @@ -202,7 +202,7 @@ static void initialize_apic_assist(struct vcpu *v) if ( page ) put_page(page); gdprintk(XENLOG_WARNING, "Bad GMFN %lx (MFN %lx)\n", gmfn, - page_to_mfn(page)); + page ? page_to_mfn(page) : INVALID_MFN); return; } |