diff options
author | jhb <jhb@FreeBSD.org> | 2003-04-02 21:54:51 +0000 |
---|---|---|
committer | jhb <jhb@FreeBSD.org> | 2003-04-02 21:54:51 +0000 |
commit | c0b4f0941651216866b58fd606374f0c651fa082 (patch) | |
tree | 192d39aebb14c6c94b48ca15c4496b9f8ebb845d | |
parent | 39cbb43bab476ff3c79356e36f26e51a6b90a692 (diff) | |
download | FreeBSD-src-c0b4f0941651216866b58fd606374f0c651fa082.zip FreeBSD-src-c0b4f0941651216866b58fd606374f0c651fa082.tar.gz |
Lock the process before sending it a SIGIO. Not doing so is a panic(2)
implementation with INVARIANTS.
-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); |