In vcpu_create after scheduler data is allocated, if
vmtrace_alloc_buffer fails, it will jump to the wrong cleanup label
resulting in a memory leak. Correct the label.

Fixes: 217dd79ee292 ("xen/domain: Add vmtrace_size domain creation parameter")
Signed-off-by: Stewart Hildebrand <stewart.hildebr...@amd.com>
---
 xen/common/domain.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/xen/common/domain.c b/xen/common/domain.c
index 3c65cca5b0ff..b1e2709d3d82 100644
--- a/xen/common/domain.c
+++ b/xen/common/domain.c
@@ -451,7 +451,7 @@ struct vcpu *vcpu_create(struct domain *d, unsigned int 
vcpu_id)
         goto fail_wq;
 
     if ( vmtrace_alloc_buffer(v) != 0 )
-        goto fail_wq;
+        goto fail_sched;
 
     if ( arch_vcpu_create(v) != 0 )
         goto fail_sched;

base-commit: a845b50c12f3ec3a14255f5eb3062d0c9801a356
-- 
2.50.1


Reply via email to