From 382172be686cf55d308e38daef0bb219fb9abe10 Mon Sep 17 00:00:00 2001 From: Mateusz Guzik Date: Wed, 10 Aug 2016 15:24:15 +0000 Subject: [PATCH] sigio: do a lockless check in funsetownlist There is no need to grab the lock first to see if sigio is used, and it typically is not. --- sys/kern/kern_descrip.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sys/kern/kern_descrip.c b/sys/kern/kern_descrip.c index 1005830df41..f3959acfbd5 100644 --- a/sys/kern/kern_descrip.c +++ b/sys/kern/kern_descrip.c @@ -942,6 +942,8 @@ funsetown(struct sigio **sigiop) { struct sigio *sigio; + if (*sigiop == NULL) + return; SIGIO_LOCK(); sigio = *sigiop; if (sigio == NULL) {