From mboxrd@z Thu Jan 1 00:00:00 1970 From: Andrew Cooper Subject: [PATCH] x86/hvm: Fix operator precedence bug introduced by 3d4d4f9336 Date: Wed, 3 Sep 2014 13:23:34 +0100 Message-ID: <1409747014-8873-1-git-send-email-andrew.cooper3@citrix.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Xen-devel Cc: Andrew Cooper , Tim Deegan , Jan Beulich , Tamas K Lengyel List-Id: xen-devel@lists.xenproject.org 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 CC: Jan Beulich CC: Tim Deegan CC: Tamas K Lengyel --- xen/arch/x86/hvm/hvm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/xen/arch/x86/hvm/hvm.c b/xen/arch/x86/hvm/hvm.c index 83e6fae..8d905d3 100644 --- a/xen/arch/x86/hvm/hvm.c +++ b/xen/arch/x86/hvm/hvm.c @@ -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 */ -- 1.7.10.4