1
0
mirror of https://github.com/openbsd/src.git synced 2026-04-24 22:26:03 +00:00

Zero struct knote on allocation. This makes the code less prone

to errors.

OK deraadt@, cheloha@, anton@
This commit is contained in:
visa
2020-02-09 14:09:08 +00:00
parent bc6981631b
commit b3424cb6ba

View File

@@ -1,4 +1,4 @@
/* $OpenBSD: kern_event.c,v 1.122 2020/02/05 17:03:13 visa Exp $ */
/* $OpenBSD: kern_event.c,v 1.123 2020/02/09 14:09:08 visa Exp $ */
/*-
* Copyright (c) 1999,2000,2001 Jonathan Lemon <jlemon@FreeBSD.org>
@@ -686,7 +686,7 @@ kqueue_register(struct kqueue *kq, struct kevent *kev, struct proc *p)
}
if (kev->flags & EV_ADD)
newkn = pool_get(&knote_pool, PR_WAITOK);
newkn = pool_get(&knote_pool, PR_WAITOK | PR_ZERO);
again:
if (fops->f_isfd) {