KVM: PPC: Book3S HV: Clean up on uvmem initialization failure
Subsystems (3)
PATCH v2 1/1 KVM: PPC: Book3S HV: Clean up on uvmem initialization failure
When kvmppc_uvmem_init() fails, kvmppc_book3s_init_hv() returns directly, bypassing the existing error path. Jump to the existing error path to clean up before returning the error.
---
Changes in v2:
- Change the Fixes tag.
- Modify the patch title.
--- arch/powerpc/kvm/book3s_hv.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/powerpc/kvm/book3s_hv.c +1 -1
@@ -6743,7 +6743,7 @@ static int kvmppc_book3s_init_hv(void) r =kvmppc_uvmem_init ();if (r <0 ) {pr_err ("KVM-HV: kvmppc_uvmem_init failed %d\n" , r); -return r; + goto err; }#if defined(CONFIG_KVM_XICS )
Signature · 1 line
2.25.1
Quoted 6 lines · Haoxiang Li
When
kvmppc_uvmem_init()fails,kvmppc_book3s_init_hv()returns directly, bypassing the existing error path. Jump to the existing error path to clean up before returning the error.Fixes 175be7e5800e ("KVM: PPC: Book3S HV: Free allocated memory if module init fails")Signed-off-by Haoxiang Li <[email protected]>
LGTM. Feel free to add:
Quoted 19 lines · Haoxiang Li
When
kvmppc_uvmem_init()fails,kvmppc_book3s_init_hv()returns directly, bypassing the existing error path. Jump to the existing error path to clean up before returning the error.Fixes 175be7e5800e ("KVM: PPC: Book3S HV: Free allocated memory if module init fails")Signed-off-by Haoxiang Li <[email protected]>---
Changes in v2:
- Change the Fixes tag.
- Modify the patch title.--- arch/powerpc/kvm/book3s_hv.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)arch/powerpc/kvm/book3s_hv.c +0
-0
arch/powerpc/kvm/book3s_hv.c static int kvmppc_book3s_init_hv(void) · line 6749
Quoted 8 lines
arch/powerpc/kvm/book3s_hv.c +1
-1@@ -6743,7 +6743,7 @@ static int kvmppc_book3s_init_hv(void) r =kvmppc_uvmem_init ();if (r <0 ) {pr_err ("KVM-HV: kvmppc_uvmem_init failed %d\n" , r); -return r; + goto err; }#if defined(CONFIG_KVM_XICS )
Quoted 5 lines · Haoxiang Li
When
kvmppc_uvmem_init()fails,kvmppc_book3s_init_hv()returns directly, bypassing the existing error path. Jump to the existing error path to clean up before returning the error.
Applied to powerpc/fixes.
[1/1] KVM: PPC: Book3S HV: Clean up on uvmem initialization failure
https://git.kernel.org/powerpc/c/e721359e5ad0292d93bb9779c4b09fbeb681c266
cheers