From f462be5365894817c8529f620fc7c0f64fb4e253 Mon Sep 17 00:00:00 2001 From: Gustavo Henrique Nihei Date: Tue, 28 Mar 2023 09:46:46 -0300 Subject: [PATCH] risc-v/espressif: Fix NULL-dereferencing in WDT interrupt handling Signed-off-by: Gustavo Henrique Nihei --- arch/risc-v/src/espressif/esp_wdt.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/arch/risc-v/src/espressif/esp_wdt.c b/arch/risc-v/src/espressif/esp_wdt.c index f423218b46..9688f943d6 100644 --- a/arch/risc-v/src/espressif/esp_wdt.c +++ b/arch/risc-v/src/espressif/esp_wdt.c @@ -74,7 +74,7 @@ struct esp_wdt_lowerhalf_s uint32_t lastreset; /* The last reset time */ bool started; /* True: Timer has been started */ xcpt_t handler; /* User Handler */ - void * upper; /* Pointer to watchdog_upperhalf_s */ + void *upper; /* Pointer to watchdog_upperhalf_s */ }; /**************************************************************************** @@ -577,7 +577,7 @@ int esp_wdt_initialize(void) /* Attach the handler for the timer IRQ */ - irq_attach(ESP_IRQ_TG0_WDT_LEVEL, (xcpt_t)wdt_handler, NULL); + irq_attach(ESP_IRQ_TG0_WDT_LEVEL, (xcpt_t)wdt_handler, lower); /* Enable the allocated CPU interrupt */