[Qemu-devel] [PATCH for-4.0 1/3] target/ppc: Fix TCG temporary leaks in gen_bcond()

Greg Kurz posted 3 patches 6 years, 10 months ago
Maintainers: David Gibson <david@gibson.dropbear.id.au>
[Qemu-devel] [PATCH for-4.0 1/3] target/ppc: Fix TCG temporary leaks in gen_bcond()
Posted by Greg Kurz 6 years, 10 months ago
Signed-off-by: Greg Kurz <groug@kaod.org>
---
 target/ppc/translate.c |    2 ++
 1 file changed, 2 insertions(+)

diff --git a/target/ppc/translate.c b/target/ppc/translate.c
index 98b37cebc2f5..aaafa3a715d8 100644
--- a/target/ppc/translate.c
+++ b/target/ppc/translate.c
@@ -3749,6 +3749,8 @@ static void gen_bcond(DisasContext *ctx, int type)
         TCGv temp = tcg_temp_new();
         if (unlikely(type == BCOND_CTR)) {
             gen_inval_exception(ctx, POWERPC_EXCP_INVAL_INVAL);
+            tcg_temp_free(temp);
+            tcg_temp_free(target);
             return;
         }
         tcg_gen_subi_tl(cpu_ctr, cpu_ctr, 1);


Re: [Qemu-devel] [Qemu-ppc] [PATCH for-4.0 1/3] target/ppc: Fix TCG temporary leaks in gen_bcond()
Posted by Suraj Jitindar Singh 6 years, 10 months ago
On Fri, 2019-03-22 at 19:03 +0100, Greg Kurz wrote:
> Signed-off-by: Greg Kurz <groug@kaod.org>

Tested-by: Suraj Jitindar Singh <sjitindarsingh@gmail.com>

> ---
>  target/ppc/translate.c |    2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/target/ppc/translate.c b/target/ppc/translate.c
> index 98b37cebc2f5..aaafa3a715d8 100644
> --- a/target/ppc/translate.c
> +++ b/target/ppc/translate.c
> @@ -3749,6 +3749,8 @@ static void gen_bcond(DisasContext *ctx, int
> type)
>          TCGv temp = tcg_temp_new();
>          if (unlikely(type == BCOND_CTR)) {
>              gen_inval_exception(ctx, POWERPC_EXCP_INVAL_INVAL);
> +            tcg_temp_free(temp);
> +            tcg_temp_free(target);
>              return;
>          }
>          tcg_gen_subi_tl(cpu_ctr, cpu_ctr, 1);
> 
> 

Re: [Qemu-devel] [PATCH for-4.0 1/3] target/ppc: Fix TCG temporary leaks in gen_bcond()
Posted by David Gibson 6 years, 10 months ago
On Fri, Mar 22, 2019 at 07:03:40PM +0100, Greg Kurz wrote:
> Signed-off-by: Greg Kurz <groug@kaod.org>

Applied to ppc-for-4.0.

> ---
>  target/ppc/translate.c |    2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/target/ppc/translate.c b/target/ppc/translate.c
> index 98b37cebc2f5..aaafa3a715d8 100644
> --- a/target/ppc/translate.c
> +++ b/target/ppc/translate.c
> @@ -3749,6 +3749,8 @@ static void gen_bcond(DisasContext *ctx, int type)
>          TCGv temp = tcg_temp_new();
>          if (unlikely(type == BCOND_CTR)) {
>              gen_inval_exception(ctx, POWERPC_EXCP_INVAL_INVAL);
> +            tcg_temp_free(temp);
> +            tcg_temp_free(target);
>              return;
>          }
>          tcg_gen_subi_tl(cpu_ctr, cpu_ctr, 1);
> 

-- 
David Gibson			| I'll have my music baroque, and my code
david AT gibson.dropbear.id.au	| minimalist, thank you.  NOT _the_ _other_
				| _way_ _around_!
http://www.ozlabs.org/~dgibson