xen/ioreq: drop the emulator reference when range set allocation fails
PATCH 1/1 xen/ioreq: drop the emulator reference when range set allocation fails
ioreq_server_init() takes a reference on the emulating domain before allocating the server's range sets, but does not release it when that allocation fails. The leaked reference prevents the emulating domain from ever being fully destroyed.
Route this failure through the existing put_domain() cleanup.
--- xen/common/ioreq.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
xen/common/ioreq.c +2 -1
@@ -595,7 +595,7 @@ static int ioreq_server_init(struct ioreq_server *s, rc =ioreq_server_alloc_rangesets (s, id);if ( rc ) -return rc; + goto fail_rangesets; s->bufioreq_handling = bufioreq_handling;
@@ -614,6 +614,7 @@ static int ioreq_server_init(struct ioreq_server *s,ioreq_server_free_rangesets (s); + fail_rangesets:put_domain (s->emulator);return rc; }
base-commit: 24bd190cd99447ec634da6cb56590ccf44ad627d
Signature · 1 line
2.47.3
Hi Edgar,
Thank you for the patch.
Best regards,
Mykola
Quoted 41 lines · Edgar E. Iglesias
ioreq_server_init()takes a reference on the emulating domain before allocating the server's range sets, but does not release it when that allocation fails. The leaked reference prevents the emulating domain from ever being fully destroyed.Route this failure through the existing
put_domain()cleanup.Fixes ccb42e0ca661 ("x86/hvm: take a reference on ioreq server emulating domain")Signed-off-by Edgar E. Iglesias <[email protected]>--- xen/common/ioreq.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)xen/common/ioreq.c +2
-1@@ -595,7 +595,7 @@ static int ioreq_server_init(struct ioreq_server *s, rc =ioreq_server_alloc_rangesets (s, id);if ( rc ) -return rc; + goto fail_rangesets; s->bufioreq_handling = bufioreq_handling;@@ -614,6 +614,7 @@ static int ioreq_server_init(struct ioreq_server *s,ioreq_server_free_rangesets (s); + fail_rangesets:put_domain (s->emulator);return rc; }base-commit:
24bd190cd99447ec634da6cb56590ccf44ad627d--
2.47.3
Quoted 9 lines · Edgar E. Iglesias
ioreq_server_init()takes a reference on the emulating domain before allocating the server's range sets, but does not release it when that allocation fails. The leaked reference prevents the emulating domain from ever being fully destroyed.Route this failure through the existing
put_domain()cleanup.Fixes ccb42e0ca661 ("x86/hvm: take a reference on ioreq server emulating domain")Signed-off-by Edgar E. Iglesias <[email protected]>