Skip to content

Commit

Permalink
fix(vfs): Fix event_write may not exit critical section
Browse files Browse the repository at this point in the history
This commit fixes the event_write() function where the critical section
was unbalanced.

Merges #12258
  • Loading branch information
udoudou authored and sudeep-mohanty committed Sep 18, 2023
1 parent 8aeff25 commit b157120
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions components/vfs/vfs_eventfd.c
Original file line number Diff line number Diff line change
@@ -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
*/
Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit b157120

Please sign in to comment.