]> xenbits.xensource.com Git - people/liuw/xen.git/commitdiff
ioreq: fix hvm_all_ioreq_servers_add_vcpu fail path cleanup
authorRoger Pau Monné <roger.pau@citrix.com>
Tue, 10 Sep 2019 14:32:47 +0000 (16:32 +0200)
committerJan Beulich <jbeulich@suse.com>
Tue, 10 Sep 2019 14:32:47 +0000 (16:32 +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>
xen/arch/x86/hvm/ioreq.c

index a79cabb6803976d226d97c0b3aa290f1128c5e18..d347144096ce7c60e0c35fe0c9cfe93cb7a147e5 100644 (file)
@@ -1195,7 +1195,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);