From b72be1ddbfe7db25a9cb5907c2ebe9d23a311d2c Mon Sep 17 00:00:00 2001 From: Xiang Xiao Date: Fri, 11 Nov 2022 14:53:38 +0800 Subject: [PATCH] epoll: Call poll_notify before unlock mutex to avoid the race condition Signed-off-by: Xiang Xiao --- fs/vfs/fs_epoll.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/vfs/fs_epoll.c b/fs/vfs/fs_epoll.c index 51e99fe256..42ff09f811 100644 --- a/fs/vfs/fs_epoll.c +++ b/fs/vfs/fs_epoll.c @@ -366,8 +366,8 @@ int epoll_ctl(int epfd, int op, int fd, FAR struct epoll_event *ev) goto err; } - nxmutex_unlock(&eph->lock); poll_notify(&eph->poll, 1, POLLIN); + nxmutex_unlock(&eph->lock); return OK; err: