The lookup should not fail because the kernel lock should prevent
simultaneous detaching on the vnode layer. However, most other device
kqfilter routines check the lookup's outcome anyway, which is maybe
a bit more forgiving.
OK mpi@
-/* $OpenBSD: bpf.c,v 1.207 2021/11/10 04:45:15 dlg Exp $ */
+/* $OpenBSD: bpf.c,v 1.208 2022/01/13 14:12:02 visa Exp $ */
/* $NetBSD: bpf.c,v 1.33 1997/02/21 23:59:35 thorpej Exp $ */
/*
KERNEL_ASSERT_LOCKED();
d = bpfilter_lookup(minor(dev));
+ if (d == NULL)
+ return (ENXIO);
switch (kn->kn_filter) {
case EVFILT_READ: