mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH v2] KVM: PPC: Book3S HV: Clean up on uvmem initialization failure
@ 2026-11-18 10:20 Haoxiang Li
  2026-11-18 11:14 ` Ritesh Harjani
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Haoxiang Li @ 2026-11-18 10:20 UTC (permalink / raw)
  To: maddy, npiggin, mpe, chleroy, ritesh.list, sshegde, farosas
  Cc: linuxppc-dev, kvm, linux-kernel, 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 <haoxiang_li2024@163.com>
---
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(-)

diff --git a/arch/powerpc/kvm/book3s_hv.c b/arch/powerpc/kvm/book3s_hv.c
index 22283d46e8fe..620097f292b8 100644
--- a/arch/powerpc/kvm/book3s_hv.c
+++ b/arch/powerpc/kvm/book3s_hv.c
@@ -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)
-- 
2.25.1


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH v2] KVM: PPC: Book3S HV: Clean up on uvmem initialization failure
  2026-11-18 10:20 [PATCH v2] KVM: PPC: Book3S HV: Clean up on uvmem initialization failure Haoxiang Li
@ 2026-11-18 11:14 ` Ritesh Harjani
  2026-11-18 18:47 ` Fabiano Rosas
  2026-11-22  4:54 ` Madhavan Srinivasan
  2 siblings, 0 replies; 4+ messages in thread
From: Ritesh Harjani @ 2026-11-18 11:14 UTC (permalink / raw)
  To: Haoxiang Li, maddy, npiggin, mpe, chleroy, sshegde, farosas
  Cc: linuxppc-dev, kvm, linux-kernel, Haoxiang Li

Haoxiang Li <haoxiang_li2024@163.com> writes:

> 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 <haoxiang_li2024@163.com>

LGTM. Feel free to add:
Reviewed-by: Ritesh Harjani (IBM) <ritesh.list@gmail.com>


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH v2] KVM: PPC: Book3S HV: Clean up on uvmem initialization failure
  2026-11-18 10:20 [PATCH v2] KVM: PPC: Book3S HV: Clean up on uvmem initialization failure Haoxiang Li
  2026-11-18 11:14 ` Ritesh Harjani
@ 2026-11-18 18:47 ` Fabiano Rosas
  2026-11-22  4:54 ` Madhavan Srinivasan
  2 siblings, 0 replies; 4+ messages in thread
From: Fabiano Rosas @ 2026-11-18 18:47 UTC (permalink / raw)
  To: Haoxiang Li, maddy, npiggin, mpe, chleroy, ritesh.list, sshegde, farosas
  Cc: linuxppc-dev, kvm, linux-kernel, Haoxiang Li

Haoxiang Li <haoxiang_li2024@163.com> writes:

> 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 <haoxiang_li2024@163.com>
> ---
> 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(-)
>
> diff --git a/arch/powerpc/kvm/book3s_hv.c b/arch/powerpc/kvm/book3s_hv.c
> index 22283d46e8fe..620097f292b8 100644
> --- a/arch/powerpc/kvm/book3s_hv.c
> +++ b/arch/powerpc/kvm/book3s_hv.c
> @@ -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)

Reviewed-by: Fabiano Rosas <farosas@suse.de>

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH v2] KVM: PPC: Book3S HV: Clean up on uvmem initialization failure
  2026-11-18 10:20 [PATCH v2] KVM: PPC: Book3S HV: Clean up on uvmem initialization failure Haoxiang Li
  2026-11-18 11:14 ` Ritesh Harjani
  2026-11-18 18:47 ` Fabiano Rosas
@ 2026-11-22  4:54 ` Madhavan Srinivasan
  2 siblings, 0 replies; 4+ messages in thread
From: Madhavan Srinivasan @ 2026-11-22  4:54 UTC (permalink / raw)
  To: npiggin, mpe, chleroy, ritesh.list, sshegde, farosas, Haoxiang Li
  Cc: linuxppc-dev, kvm, linux-kernel

On Wed, 18 Nov 2026 18:20:12 +0800, Haoxiang Li wrote:
> 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

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2026-11-22  4:55 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-11-18 10:20 [PATCH v2] KVM: PPC: Book3S HV: Clean up on uvmem initialization failure Haoxiang Li
2026-11-18 11:14 ` Ritesh Harjani
2026-11-18 18:47 ` Fabiano Rosas
2026-11-22  4:54 ` Madhavan Srinivasan

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®