Skip to content

Commit

Permalink
x86/shadow: correct an inverted conditional in dirty VRAM tracking
Browse files Browse the repository at this point in the history
This originally was "mfn_x(mfn) == INVALID_MFN". Make it like this
again, taking the opportunity to also drop the unnecessary nearby
braces.

This is XSA-319.

Fixes: 246a5a3 ("xen: Use a typesafe to define INVALID_MFN")
Signed-off-by: Jan Beulich <jbeulich@suse.com>
Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
  • Loading branch information
jbeulich committed Jul 7, 2020
1 parent 2e9c2bc commit 23a216f
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions xen/arch/x86/mm/shadow/common.c
Original file line number Diff line number Diff line change
Expand Up @@ -3253,10 +3253,8 @@ int shadow_track_dirty_vram(struct domain *d,
int dirty = 0;
paddr_t sl1ma = dirty_vram->sl1ma[i];

if ( !mfn_eq(mfn, INVALID_MFN) )
{
if ( mfn_eq(mfn, INVALID_MFN) )
dirty = 1;
}
else
{
page = mfn_to_page(mfn);
Expand Down

0 comments on commit 23a216f

Please sign in to comment.