x86/mem_sharing: Release domain if we are not able to enable memory sharing
PATCH 1/1 x86/mem_sharing: Release domain if we are not able to enable memory sharing
In case it's not possible to enable memory sharing (mem_sharing_control fails) we just return the error code without releasing the domain acquired some lines above by rcu_lock_live_remote_domain_by_id.
--
I didn't manage to check the change, I was just looking at the code for different purposes.
--- xen/arch/x86/mm/mem_sharing.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
xen/arch/x86/mm/mem_sharing.c +1 -1
@@ -2013,7 +2013,7 @@ int mem_sharing_memop(XEN_GUEST_HANDLE_PARAM(xen_mem_sharing_op_t) arg)if ( !mem_sharing_enabled (d) && (rc =mem_sharing_control (d, true,0 )) ) -return rc; + goto out;switch ( mso.op ) {
Signature · 1 line
2.34.1
Quoted 3 lines · Frediano Ziglio
In case it's not possible to enable memory sharing (
mem_sharing_controlfails) we just return the error code without releasing the domain acquired some lines above byrcu_lock_live_remote_domain_by_id.
Quoted 1 line
Signed-off-by Frediano Ziglio <[email protected]>
That was simply a broken transformation in the patch.
Tamas K Lengyel
Acked-byQuoted 11 lines · Andrew Cooper
Quoted 3 lines · Frediano Ziglio
In case it's not possible to enable memory sharing (
mem_sharing_controlfails) we just return the error code without releasing the domain acquired some lines above byrcu_lock_live_remote_domain_by_id.Fixes 72f8d45d69b8 ("x86/mem_sharing: enable mem_sharing on first memop")Quoted 1 line
Signed-off-by Frediano Ziglio <[email protected]>Reviewed-by Andrew Cooper <[email protected]>