The 'idx' can equal to the max number of vCPUs, fix it.

Signed-off-by: Feng Wu <feng...@intel.com>
---
 xen/drivers/passthrough/io.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/xen/drivers/passthrough/io.c b/xen/drivers/passthrough/io.c
index 9e6b46c..66577b6 100644
--- a/xen/drivers/passthrough/io.c
+++ b/xen/drivers/passthrough/io.c
@@ -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];
-- 
2.1.0


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel

Reply via email to