From 98d97f27fd37c2b906e6c90fbfc65194ee20afc1 Mon Sep 17 00:00:00 2001 From: chenwen Date: Tue, 27 Apr 2021 16:56:18 +0800 Subject: [PATCH] xtensa/esp32: Fix crash issue caused by null pointer operation --- arch/xtensa/src/esp32/esp32_wifi_adapter.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/arch/xtensa/src/esp32/esp32_wifi_adapter.c b/arch/xtensa/src/esp32/esp32_wifi_adapter.c index c7e9860a687..44b014c8d2c 100644 --- a/arch/xtensa/src/esp32/esp32_wifi_adapter.c +++ b/arch/xtensa/src/esp32/esp32_wifi_adapter.c @@ -1802,8 +1802,10 @@ static int32_t esp_task_create_pinned_to_core(void *entry, (char * const *)param); if (pid > 0) { - *((int *)task_handle) = pid; - + if (task_handle != NULL) + { + *((int *)task_handle) = pid; + } #ifdef CONFIG_SMP if (core_id < CONFIG_SMP_NCPUS) {