risc-v/espressif: Fix NULL-dereferencing in WDT interrupt handling

Signed-off-by: Gustavo Henrique Nihei <gustavo.nihei@espressif.com>
This commit is contained in:
Gustavo Henrique Nihei 2023-03-28 09:46:46 -03:00 committed by Petro Karashchenko
parent b87eb7c82f
commit f462be5365

View File

@ -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 */