From: Roger Pau Monné Date: Mon, 23 Sep 2019 12:42:13 +0000 (+0200) Subject: ioreq: fix hvm_all_ioreq_servers_add_vcpu fail path cleanup X-Git-Tag: archive/raspbian/4.11.3+24-g14b62ab3e5-1+rpi1^2~55^2~102 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=b2220461a3081d23ed9c36dc053161d58655da97;p=xen.git ioreq: fix hvm_all_ioreq_servers_add_vcpu fail path cleanup 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é Reviewed-by: Paul Durrant master commit: 215f2576b0ac1bc18f3ff74e34f0d8379bda9040 master date: 2019-09-10 16:32:47 +0200 --- diff --git a/xen/arch/x86/hvm/ioreq.c b/xen/arch/x86/hvm/ioreq.c index ac05875af1..f95fb18c1f 100644 --- a/xen/arch/x86/hvm/ioreq.c +++ b/xen/arch/x86/hvm/ioreq.c @@ -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);