Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

semaphore is not released when cy_wcm_init() fails #5

Open
richardlc68 opened this issue May 9, 2024 · 1 comment
Open

semaphore is not released when cy_wcm_init() fails #5

richardlc68 opened this issue May 9, 2024 · 1 comment

Comments

@richardlc68
Copy link

Prerequisites

Can you reproduce the problem reliably?
yes
Did you check current release notes for known issues?
yes

Description:

There are two places the two semaphores are not released when following call fails at function cy_wcm_init() in file cy_wcm.c:

starting from line 770:

    if((res = init_whd_wifi_interface(config->interface)) != CY_RSLT_SUCCESS)
    {
        cy_wcm_log_msg(CYLF_MIDDLEWARE, CY_LOG_ERR, "Error : Initializing Wi-Fi interface \n");
        cy_rtos_deinit_mutex(&wcm_mutex);
        cy_rtos_semaphore_deinit(&stop_scan_semaphore);                      // ----- missing
        cy_rtos_semaphore_deinit(&security_type_start_scan_semaphore);       // ----- missing
        return res;
    }

starting from line 784:

    if(cy_worker_thread_create(&cy_wcm_worker_thread, &params) != CY_RSLT_SUCCESS)
    {
        cy_rtos_deinit_mutex(&wcm_mutex);
        cy_rtos_semaphore_deinit(&stop_scan_semaphore);                   // ----- missing
        cy_rtos_semaphore_deinit(&security_type_start_scan_semaphore);    // ----- missing
        return CY_RSLT_WCM_MUTEX_ERROR;
    }
@krshnarajd
Copy link

This is addressed in release-v3.6.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants