Merge branch 'contrib/github_pr_12258' into 'master'

fix(vfs): Fix event_write may not exit critical section (GitHub PR)

Closes IDFGH-11084

See merge request espressif/esp-idf!26012
pull/12330/head
Sudeep Mohanty 2023-09-19 14:50:40 +08:00
commit 9d0b39cc56
1 zmienionych plików z 5 dodań i 5 usunięć

Wyświetl plik

@ -1,5 +1,5 @@
/*
* SPDX-FileCopyrightText: 2021-2022 Espressif Systems (Shanghai) CO LTD
* SPDX-FileCopyrightText: 2021-2023 Espressif Systems (Shanghai) CO LTD
*
* SPDX-License-Identifier: Apache-2.0
*/
@ -267,14 +267,14 @@ static ssize_t event_write(int fd, const void *data, size_t size)
s_events[fd].value += *val;
ret = size;
trigger_select_for_event(&s_events[fd]);
if (s_events[fd].support_isr) {
portEXIT_CRITICAL(&s_events[fd].data_spin_lock);
}
} else {
errno = EBADF;
ret = -1;
}
if (s_events[fd].support_isr) {
portEXIT_CRITICAL(&s_events[fd].data_spin_lock);
}
_lock_release_recursive(&s_events[fd].lock);
}
return ret;