[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH v7 1/4] target/riscv: Check for valid itimer pointer before f
From: |
Alistair Francis |
Subject: |
Re: [PATCH v7 1/4] target/riscv: Check for valid itimer pointer before free |
Date: |
Mon, 29 Apr 2024 14:04:34 +1000 |
On Fri, Mar 15, 2024 at 5:01 AM Himanshu Chauhan
<hchauhan@ventanamicro.com> wrote:
>
> Check if each element of array of pointers for itimer contains a non-null
> pointer before freeing.
>
> Signed-off-by: Himanshu Chauhan <hchauhan@ventanamicro.com>
Reviewed-by: Alistair Francis <alistair.francis@wdc.com>
Alistair
> ---
> target/riscv/debug.c | 5 ++++-
> 1 file changed, 4 insertions(+), 1 deletion(-)
>
> diff --git a/target/riscv/debug.c b/target/riscv/debug.c
> index e30d99cc2f..5f14b39b06 100644
> --- a/target/riscv/debug.c
> +++ b/target/riscv/debug.c
> @@ -938,7 +938,10 @@ void riscv_trigger_reset_hold(CPURISCVState *env)
> env->tdata3[i] = 0;
> env->cpu_breakpoint[i] = NULL;
> env->cpu_watchpoint[i] = NULL;
> - timer_del(env->itrigger_timer[i]);
> + if (env->itrigger_timer[i]) {
> + timer_del(env->itrigger_timer[i]);
> + env->itrigger_timer[i] = NULL;
> + }
> }
>
> env->mcontext = 0;
> --
> 2.34.1
>
>
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- Re: [PATCH v7 1/4] target/riscv: Check for valid itimer pointer before free,
Alistair Francis <=