Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/kern In knote(), don't call kn->kn_fop->f_event() direct...



details:   https://anonhg.NetBSD.org/src/rev/724eb87e9567
branches:  trunk
changeset: 987499:724eb87e9567
user:      thorpej <thorpej%NetBSD.org@localhost>
date:      Thu Sep 30 01:12:06 2021 +0000

description:
In knote(), don't call kn->kn_fop->f_event() directly; use filter_event()
to get the correct KERNEL_LOCK handling for the filter attached to that
specific note.

diffstat:

 sys/kern/kern_event.c |  9 ++++-----
 1 files changed, 4 insertions(+), 5 deletions(-)

diffs (31 lines):

diff -r 4f28baa290be -r 724eb87e9567 sys/kern/kern_event.c
--- a/sys/kern/kern_event.c     Wed Sep 29 15:17:01 2021 +0000
+++ b/sys/kern/kern_event.c     Thu Sep 30 01:12:06 2021 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: kern_event.c,v 1.126 2021/09/26 23:37:40 thorpej Exp $ */
+/*     $NetBSD: kern_event.c,v 1.127 2021/09/30 01:12:06 thorpej Exp $ */
 
 /*-
  * Copyright (c) 2008, 2009 The NetBSD Foundation, Inc.
@@ -59,7 +59,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: kern_event.c,v 1.126 2021/09/26 23:37:40 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: kern_event.c,v 1.127 2021/09/30 01:12:06 thorpej Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -1856,10 +1856,9 @@
        struct knote *kn, *tmpkn;
 
        SLIST_FOREACH_SAFE(kn, list, kn_selnext, tmpkn) {
-               KASSERT(kn->kn_fop != NULL);
-               KASSERT(kn->kn_fop->f_event != NULL);
-               if ((*kn->kn_fop->f_event)(kn, hint))
+               if (filter_event(kn, hint)) {
                        knote_activate(kn);
+               }
        }
 }
 



Home | Main Index | Thread Index | Old Index