diff mbox series

[PATCH-for-6.0?] target/mips: Fix TCG temporary leak in gen_cache_operation()

Message ID 20210406202857.1440744-1-f4bug@amsat.org (mailing list archive)
State New, archived
Headers show
Series [PATCH-for-6.0?] target/mips: Fix TCG temporary leak in gen_cache_operation() | expand

Commit Message

Philippe Mathieu-Daudé April 6, 2021, 8:28 p.m. UTC
Fix a TCG temporary leak when translating CACHE opcode.

Fixes: 0d74a222c27 ("make ITC Configuration Tags accessible to the CPU")
Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
---
 target/mips/translate.c | 2 ++
 1 file changed, 2 insertions(+)

Comments

Richard Henderson April 6, 2021, 11:07 p.m. UTC | #1
On 4/6/21 1:28 PM, Philippe Mathieu-Daudé wrote:
> Fix a TCG temporary leak when translating CACHE opcode.
> 
> Fixes: 0d74a222c27 ("make ITC Configuration Tags accessible to the CPU")
> Signed-off-by: Philippe Mathieu-Daudé<f4bug@amsat.org>
> ---
>   target/mips/translate.c | 2 ++
>   1 file changed, 2 insertions(+)

Reviewed-by: Richard Henderson <richard.henderson@linaro.org>


r~
diff mbox series

Patch

diff --git a/target/mips/translate.c b/target/mips/translate.c
index c518bf3963b..71fa5ec1973 100644
--- a/target/mips/translate.c
+++ b/target/mips/translate.c
@@ -12804,6 +12804,8 @@  static void gen_cache_operation(DisasContext *ctx, uint32_t op, int base,
     TCGv t1 = tcg_temp_new();
     gen_base_offset_addr(ctx, t1, base, offset);
     gen_helper_cache(cpu_env, t1, t0);
+    tcg_temp_free(t1);
+    tcg_temp_free_i32(t0);
 }
 
 #if defined(TARGET_MIPS64)