Date: Tue, 25 Jan 2011 10:17:37 +0000 (UTC) From: Konstantin Belousov <kib@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r217817 - stable/8/sys/amd64/amd64 Message-ID: <201101251017.p0PAHbh9025638@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: kib Date: Tue Jan 25 10:17:37 2011 New Revision: 217817 URL: http://svn.freebsd.org/changeset/base/217817 Log: MFC r217563: Use malloc(9) instead of kmem_alloc(9) for temporal copy of the user-supplied descriptor array. Modified: stable/8/sys/amd64/amd64/sys_machdep.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) Modified: stable/8/sys/amd64/amd64/sys_machdep.c ============================================================================== --- stable/8/sys/amd64/amd64/sys_machdep.c Tue Jan 25 10:14:12 2011 (r217816) +++ stable/8/sys/amd64/amd64/sys_machdep.c Tue Jan 25 10:17:37 2011 (r217817) @@ -105,19 +105,13 @@ sysarch_ldt(struct thread *td, struct sy case I386_SET_LDT: td->td_pcb->pcb_full_iret = 1; 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?201101251017.p0PAHbh9025638>