diff options
-rw-r--r-- | sys/kern/subr_bus.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/sys/kern/subr_bus.c b/sys/kern/subr_bus.c index b6e8d21..6c59558 100644 --- a/sys/kern/subr_bus.c +++ b/sys/kern/subr_bus.c @@ -383,6 +383,7 @@ static void devaddq(const char *type, const char *what, device_t dev) { struct dev_event_info *n1 = NULL; + struct proc *p; char *data = NULL; char *loc; const char *parstr; @@ -412,8 +413,12 @@ devaddq(const char *type, const char *what, device_t dev) cv_broadcast(&devsoftc.cv); mtx_unlock(&devsoftc.mtx); selwakeup(&devsoftc.sel); - if (devsoftc.async_proc) - psignal(devsoftc.async_proc, SIGIO); + p = devsoftc.async_proc; + if (p != NULL) { + PROC_LOCK(p); + psignal(p, SIGIO); + PROC_UNLOCK(p); + } return; bad:; free(data, M_BUS); |