]> xenbits.xensource.com Git - people/dwmw2/xen.git/commitdiff
ioreq: fix hvm_all_ioreq_servers_add_vcpu fail path cleanup
authorRoger Pau Monné <roger.pau@citrix.com>
Mon, 23 Sep 2019 12:42:13 +0000 (14:42 +0200)
committerJan Beulich <jbeulich@suse.com>
Mon, 23 Sep 2019 12:42:13 +0000 (14:42 +0200)
The loop in FOR_EACH_IOREQ_SERVER is backwards hence the cleanup on
failure needs to be done forwards.

Fixes: 97a5a3e30161 ('x86/hvm/ioreq: maintain an array of ioreq servers rather than a list')
Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
Reviewed-by: Paul Durrant <paul.durrant@citrix.com>
master commit: 215f2576b0ac1bc18f3ff74e34f0d8379bda9040
master date: 2019-09-10 16:32:47 +0200

xen/arch/x86/hvm/ioreq.c

index ac05875af18a4171b615a5a00734ca69a516cb33..f95fb18c1f50cc5b3fec86171ecc8b7a3adb1996 100644 (file)
@@ -1246,7 +1246,7 @@ int hvm_all_ioreq_servers_add_vcpu(struct domain *d, struct vcpu *v)
     return 0;
 
  fail:
-    while ( id-- != 0 )
+    while ( ++id != MAX_NR_IOREQ_SERVERS )
     {
         s = GET_IOREQ_SERVER(d, id);