From b3c208462f0583e170d64dbf983bcdb2d1fe2508 Mon Sep 17 00:00:00 2001 From: sbruno Date: Fri, 19 Jun 2015 18:57:36 +0000 Subject: [PATCH] Feedback from commit r284535 davide: imgact_binmisc_clear_entry() needs to use atomic ops to remove the enable bit. kib: M_NOWAIT is not warranted and comment is invalid. --- sys/kern/imgact_binmisc.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/sys/kern/imgact_binmisc.c b/sys/kern/imgact_binmisc.c index 4c65c66238bd..980241c3c740 100644 --- a/sys/kern/imgact_binmisc.c +++ b/sys/kern/imgact_binmisc.c @@ -317,7 +317,7 @@ imgact_binmisc_disable_entry(char *name) return (ENOENT); } - ibe->ibe_flags &= ~IBF_ENABLED; + atomic_clear_32(&ibe->ibe_flags, IBF_ENABLED); sx_sunlock(&interp_list_sx); return (0); @@ -406,8 +406,7 @@ imgact_binmisc_get_all_entries(struct sysctl_req *req) sx_slock(&interp_list_sx); count = interp_list_entry_count; - /* Don't block in malloc() while holding lock. */ - xbe = malloc(sizeof(*xbe) * count, M_BINMISC, M_NOWAIT|M_ZERO); + xbe = malloc(sizeof(*xbe) * count, M_BINMISC, M_ZERO); if (!xbe) { sx_sunlock(&interp_list_sx); return (ENOMEM);