git: 090c9ea98d32 - stable/15 - kevent: do not check knote lists being empty before removing a knote
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Fri, 17 Apr 2026 00:42:45 UTC
The branch stable/15 has been updated by kib:
URL: https://cgit.FreeBSD.org/src/commit/?id=090c9ea98d320bc3fa7794d4f668c44ff6902117
commit 090c9ea98d320bc3fa7794d4f668c44ff6902117
Author: Konstantin Belousov <kib@FreeBSD.org>
AuthorDate: 2026-04-10 08:27:51 +0000
Commit: Konstantin Belousov <kib@FreeBSD.org>
CommitDate: 2026-04-17 00:42:38 +0000
kevent: do not check knote lists being empty before removing a knote
(cherry picked from commit 31069fdbdae1027a6f1af7d56d418de4428ac6d9)
---
sys/kern/kern_event.c | 3 +--
sys/kern/vfs_aio.c | 6 ++----
2 files changed, 3 insertions(+), 6 deletions(-)
diff --git a/sys/kern/kern_event.c b/sys/kern/kern_event.c
index 01731ca46b6b..8c7a0949f024 100644
--- a/sys/kern/kern_event.c
+++ b/sys/kern/kern_event.c
@@ -2953,8 +2953,7 @@ knote_drop_detached(struct knote *kn, struct thread *td)
else
list = &kq->kq_knhash[KN_HASH(kn->kn_id, kq->kq_knhashmask)];
- if (!SLIST_EMPTY(list))
- SLIST_REMOVE(list, kn, knote, kn_link);
+ SLIST_REMOVE(list, kn, knote, kn_link);
if (kn->kn_status & KN_QUEUED)
knote_dequeue(kn);
KQ_UNLOCK_FLUX(kq);
diff --git a/sys/kern/vfs_aio.c b/sys/kern/vfs_aio.c
index 2a790237d30e..da0e36fc1ec5 100644
--- a/sys/kern/vfs_aio.c
+++ b/sys/kern/vfs_aio.c
@@ -2668,8 +2668,7 @@ filt_aiodetach(struct knote *kn)
knl = &kn->kn_ptr.p_aio->klist;
knl->kl_lock(knl->kl_lockarg);
- if (!knlist_empty(knl))
- knlist_remove(knl, kn, 1);
+ knlist_remove(knl, kn, 1);
knl->kl_unlock(knl->kl_lockarg);
}
@@ -2718,8 +2717,7 @@ filt_liodetach(struct knote *kn)
knl = &kn->kn_ptr.p_lio->klist;
knl->kl_lock(knl->kl_lockarg);
- if (!knlist_empty(knl))
- knlist_remove(knl, kn, 1);
+ knlist_remove(knl, kn, 1);
knl->kl_unlock(knl->kl_lockarg);
}