]> xenbits.xensource.com Git - people/iwj/xen.git/commitdiff
vpci/msix: fix incorrect usage of bitmask
authorRoger Pau Monné <roger.pau@citrix.com>
Mon, 26 Mar 2018 13:17:12 +0000 (15:17 +0200)
committerJan Beulich <jbeulich@suse.com>
Mon, 26 Mar 2018 13:17:12 +0000 (15:17 +0200)
The bitmask to clear the low bits of the address field should be
~0xffffffffull, the current mask clears both the low and the high bits
of the address field, which is a bug.

Reported-by: Coverity
Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
Reviewed-by: Jan Beulich <jbeulich@suse.com>
xen/drivers/vpci/msix.c

index 3b378c2e51b866a6dc69c72c45cc4114bd1c839f..bcf63256f6f0c87727699fff2b1530f27b5cee40 100644 (file)
@@ -328,7 +328,7 @@ static int msix_write(struct vcpu *v, unsigned long addr, unsigned int len,
             entry->addr = data;
             break;
         }
-        entry->addr &= ~0xffffffff;
+        entry->addr &= ~0xffffffffull;
         entry->addr |= data;
         break;