diff options
| author | Konstantin Belousov <kib@FreeBSD.org> | 2008-09-23 17:23:59 +0000 |
|---|---|---|
| committer | Konstantin Belousov <kib@FreeBSD.org> | 2008-09-23 17:23:59 +0000 |
| commit | ec96f542704475f2dcc2c1f2198bccd7abbb9796 (patch) | |
| tree | 577baf47bd0f34ce41bdfed55f85b53ca03705e6 /sys/i386 | |
| parent | 996ec991cf5694929c1bd0e99b1487983b6e3611 (diff) | |
Notes
Diffstat (limited to 'sys/i386')
| -rw-r--r-- | sys/i386/i386/sys_machdep.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/sys/i386/i386/sys_machdep.c b/sys/i386/i386/sys_machdep.c index 52c7603d3bac..5d53aa8b73ea 100644 --- a/sys/i386/i386/sys_machdep.c +++ b/sys/i386/i386/sys_machdep.c @@ -406,7 +406,8 @@ user_ldt_alloc(struct mdproc *mdp, int len) len * sizeof(union descriptor)); if (new_ldt->ldt_base == NULL) { FREE(new_ldt, M_SUBPROC); - return NULL; + mtx_lock_spin(&dt_lock); + return (NULL); } new_ldt->ldt_refcnt = 1; new_ldt->ldt_active = 0; @@ -437,8 +438,10 @@ user_ldt_free(struct thread *td) struct proc_ldt *pldt; mtx_assert(&dt_lock, MA_OWNED); - if ((pldt = mdp->md_ldt) == NULL) + if ((pldt = mdp->md_ldt) == NULL) { + mtx_unlock_spin(&dt_lock); return; + } if (td == PCPU_GET(curthread)) { lldt(_default_ldt); |
