From e5eaa355536382edbc476fe62b5035d0081b2db4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=B8=81=E6=AC=A3=E7=AB=A5?= Date: Fri, 12 Mar 2021 11:40:05 +0800 Subject: [PATCH] vfs/epoll: Fix one bug of EPOLL_CTL_DEL. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit N/A Signed-off-by: 丁欣童 Change-Id: I91ec9fbf4b3884cb29bf30c4ff69a6c5df7f30ca --- 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 ef544184cd1..90fb8f95df0 100644 --- a/fs/vfs/fs_epoll.c +++ b/fs/vfs/fs_epoll.c @@ -275,7 +275,7 @@ int epoll_ctl(int epfd, int op, int fd, struct epoll_event *ev) { if (eph->poll[i].fd == fd) { - if (i != eph->occupied - 1) + if (i != eph->occupied) { memmove(&eph->data[i], &eph->data[i + 1], sizeof(epoll_data_t) * (eph->occupied - i));