diff --git a/sys/i386/i386/sys_machdep.c b/sys/i386/i386/sys_machdep.c index 7d576db90fc4..b5bac44f9d58 100644 --- a/sys/i386/i386/sys_machdep.c +++ b/sys/i386/i386/sys_machdep.c @@ -539,7 +539,7 @@ i386_get_ldt(struct thread *td, struct i386_ldt_args *uap) data = malloc(num * sizeof(union descriptor), M_TEMP, M_WAITOK); mtx_lock_spin(&dt_lock); pldt = td->td_proc->p_md.md_ldt; - nldt = pldt != NULL ? pldt->ldt_len : nitems(ldt); + nldt = pldt != NULL ? pldt->ldt_len : NLDT; if (uap->start >= nldt) { num = 0; } else {