Date: Tue, 18 Jan 2011 22:56:10 +0000 (UTC) From: Konstantin Belousov <kib@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r217563 - head/sys/amd64/amd64 Message-ID: <201101182256.p0IMuAuE054943@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: kib Date: Tue Jan 18 22:56:10 2011 New Revision: 217563 URL: http://svn.freebsd.org/changeset/base/217563 Log: Use malloc(9) instead of kmem_alloc(9) for temporal copy of the user-supplied descriptor array. Noted and reviewed by: jhb (previous version) MFC after: 1 week Modified: head/sys/amd64/amd64/sys_machdep.c Modified: head/sys/amd64/amd64/sys_machdep.c ============================================================================== --- head/sys/amd64/amd64/sys_machdep.c Tue Jan 18 22:19:55 2011 (r217562) +++ head/sys/amd64/amd64/sys_machdep.c Tue Jan 18 22:56:10 2011 (r217563) @@ -105,19 +105,13 @@ sysarch_ldt(struct thread *td, struct sy return (EINVAL); set_pcb_flags(td->td_pcb, PCB_FULL_IRET); if (largs->descs != NULL) { - lp = (struct user_segment_descriptor *) - kmem_alloc(kernel_map, largs->num * - sizeof(struct user_segment_descriptor)); - if (lp == NULL) { - error = ENOMEM; - break; - } + lp = malloc(largs->num * sizeof(struct + user_segment_descriptor), M_TEMP, M_WAITOK); error = copyin(largs->descs, lp, largs->num * sizeof(struct user_segment_descriptor)); if (error == 0) error = amd64_set_ldt(td, largs, lp); - kmem_free(kernel_map, (vm_offset_t)lp, largs->num * - sizeof(struct user_segment_descriptor)); + free(lp, M_TEMP); } else { error = amd64_set_ldt(td, largs, NULL); }
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201101182256.p0IMuAuE054943>