Skip to content

Commit 12af4b0

Browse files
Kyle Kearneyromanjoe
authored andcommitted
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.
1 parent 2804b65 commit 12af4b0

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

targets/TARGET_Cypress/TARGET_PSOC6/common/cybsp_wifi.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,7 @@ cy_rslt_t cybsp_wifi_init_primary(whd_interface_t* interface)
186186
{
187187
whd_init_config_t whd_init_config;
188188
whd_init_config.thread_stack_size = (uint32_t)THREAD_STACK_SIZE;
189-
whd_init_config.thread_stack_start = (uint8_t *)malloc(THREAD_STACK_SIZE);
189+
whd_init_config.thread_stack_start = NULL;
190190
whd_init_config.thread_priority = (uint32_t)THREAD_PRIORITY;
191191
whd_init_config.country = COUNTRY;
192192

0 commit comments

Comments
 (0)