x86/hvm: fix operator precedence bug introduced by 3d4d4f9336
authorAndrew Cooper <andrew.cooper3@citrix.com>
Wed, 3 Sep 2014 13:06:06 +0000 (15:06 +0200)
committerJan Beulich <jbeulich@suse.com>
Wed, 3 Sep 2014 13:06:06 +0000 (15:06 +0200)
Bitwise or has greater precedence than the ternary operator, making the result
of the expression a constant P2M_UNSHARE.

Coverity-ID: 1234633
Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
Signed-off-by: Jan Beulich <jbeulich@suse.com>
Reviewed-by: Don Slutz <dslutz@verizon.com>
xen/arch/x86/hvm/hvm.c

index 83e6faefb17d60cb916385f712c553d1b9b7c296..8d905d369c28a804aadc57805b396766de61046b 100644 (file)
@@ -2796,7 +2796,7 @@ int hvm_hap_nested_page_fault(paddr_t gpa, unsigned long gla,
 
     p2m = p2m_get_hostp2m(v->domain);
     mfn = get_gfn_type_access(p2m, gfn, &p2mt, &p2ma, 
-                              P2M_ALLOC | npfec.write_access ? P2M_UNSHARE : 0,
+                              P2M_ALLOC | (npfec.write_access ? P2M_UNSHARE : 0),
                               NULL);
 
     /* Check access permissions first, then handle faults */