git: 90b560f7bae6 - main - sys_procdesc: extract procdesc_destroy()
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Tue, 07 Jul 2026 01:57:13 UTC
The branch main has been updated by kib:
URL: https://cgit.FreeBSD.org/src/commit/?id=90b560f7bae649f9770e787d9e268401a1319493
commit 90b560f7bae649f9770e787d9e268401a1319493
Author: Konstantin Belousov <kib@FreeBSD.org>
AuthorDate: 2026-06-05 01:42:44 +0000
Commit: Konstantin Belousov <kib@FreeBSD.org>
CommitDate: 2026-07-07 01:23:48 +0000
sys_procdesc: extract procdesc_destroy()
Reviewed byL markj
Tested by: pho
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D57124
---
sys/kern/sys_procdesc.c | 12 +++++++++---
1 file changed, 9 insertions(+), 3 deletions(-)
diff --git a/sys/kern/sys_procdesc.c b/sys/kern/sys_procdesc.c
index 69f327e3604e..e6174ea3cbb9 100644
--- a/sys/kern/sys_procdesc.c
+++ b/sys/kern/sys_procdesc.c
@@ -272,6 +272,14 @@ procdesc_finit(struct procdesc *pdp, struct file *fp)
finit(fp, FREAD | FWRITE, DTYPE_PROCDESC, pdp, &procdesc_ops);
}
+static void
+procdesc_destroy(struct procdesc *pd)
+{
+ knlist_destroy(&pd->pd_selinfo.si_note);
+ PROCDESC_LOCK_DESTROY(pd);
+ free(pd, M_PROCDESC);
+}
+
static void
procdesc_free(struct procdesc *pd)
{
@@ -292,9 +300,7 @@ procdesc_free(struct procdesc *pd)
proc_id_clear(PROC_ID_PID, pd->pd_pid);
seldrain(&pd->pd_selinfo);
- knlist_destroy(&pd->pd_selinfo.si_note);
- PROCDESC_LOCK_DESTROY(pd);
- free(pd, M_PROCDESC);
+ procdesc_destroy(pd);
}
}