diff options
author | marcel <marcel@FreeBSD.org> | 2003-12-10 01:59:23 +0000 |
---|---|---|
committer | marcel <marcel@FreeBSD.org> | 2003-12-10 01:59:23 +0000 |
commit | b6631c500b60af6940dbcee6a8ac4439d2491f07 (patch) | |
tree | 0be9d3954bbeb43fd1472bd3c16e9facdccca175 /sys/kern/kern_thread.c | |
parent | 1f8c5c54fd77f203bfb1e19b8afcae1b868d3008 (diff) | |
download | FreeBSD-src-b6631c500b60af6940dbcee6a8ac4439d2491f07.zip FreeBSD-src-b6631c500b60af6940dbcee6a8ac4439d2491f07.tar.gz |
Write the thread pointer (val) in the kse mailbox (loc) before we
set the new context in kse_switchin(2). This allows us to return
an error to the calling context when the suword() fails.
Diffstat (limited to 'sys/kern/kern_thread.c')
-rw-r--r-- | sys/kern/kern_thread.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/sys/kern/kern_thread.c b/sys/kern/kern_thread.c index f47beec..a08805e 100644 --- a/sys/kern/kern_thread.c +++ b/sys/kern/kern_thread.c @@ -399,10 +399,10 @@ kse_switchin(struct thread *td, struct kse_switchin_args *uap) error = (uap->mcp == NULL) ? EINVAL : 0; if (!error) error = copyin(uap->mcp, &mc, sizeof(mc)); + if (!error && uap->loc != NULL) + error = (suword(uap->loc, uap->val) != 0) ? EINVAL : 0; if (!error) error = set_mcontext(td, &mc); - if (!error && uap->loc != NULL) - suword(uap->loc, uap->val); return ((error == 0) ? EJUSTRETURN : error); } |