passthrough: fix a BUG_ON issue
authorFeng Wu <feng.wu@intel.com>
Wed, 31 Aug 2016 16:13:47 +0000 (18:13 +0200)
committerJan Beulich <jbeulich@suse.com>
Wed, 31 Aug 2016 16:13:47 +0000 (18:13 +0200)
The 'idx' can equal to the max number of vCPUs, fix it.

Signed-off-by: Feng Wu <feng.wu@intel.com>
Acked-by: Jan Beulich <jbeulich@suse.com>
xen/drivers/passthrough/io.c

index 9e6b46cd63b3890dd7e1af6a76ba1213088ea390..66577b6c44e77ef307dea231350c875bc770d45f 100644 (file)
@@ -243,7 +243,7 @@ static struct vcpu *vector_hashing_dest(const struct domain *d,
         for ( i = 0; i <= mod; i++ )
         {
             idx = find_next_bit(dest_vcpu_bitmap, d->max_vcpus, idx) + 1;
-            BUG_ON(idx >= d->max_vcpus);
+            BUG_ON(idx > d->max_vcpus);
         }
 
         dest = d->vcpu[idx - 1];