From d067952b6f64f46c130c5eef3e0560d30c92ce1b Mon Sep 17 00:00:00 2001 From: Kyle Kearney Date: Thu, 19 Sep 2019 11:05:05 -0700 Subject: [PATCH] Avoid doubly allocating whd thread stack Don't malloc during wifi initialization, as that could cause double allocation in some cases. The thread stack will be allocated by cy_rtos_thread_start if necessary. --- targets/TARGET_Cypress/TARGET_PSOC6/common/cybsp_wifi.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/targets/TARGET_Cypress/TARGET_PSOC6/common/cybsp_wifi.c b/targets/TARGET_Cypress/TARGET_PSOC6/common/cybsp_wifi.c index 8f8694c22e..8853439802 100644 --- a/targets/TARGET_Cypress/TARGET_PSOC6/common/cybsp_wifi.c +++ b/targets/TARGET_Cypress/TARGET_PSOC6/common/cybsp_wifi.c @@ -186,7 +186,7 @@ cy_rslt_t cybsp_wifi_init_primary(whd_interface_t* interface) { whd_init_config_t whd_init_config; whd_init_config.thread_stack_size = (uint32_t)THREAD_STACK_SIZE; - whd_init_config.thread_stack_start = (uint8_t *)malloc(THREAD_STACK_SIZE); + whd_init_config.thread_stack_start = NULL; whd_init_config.thread_priority = (uint32_t)THREAD_PRIORITY; whd_init_config.country = COUNTRY;