From owner-svn-src-stable-8@FreeBSD.ORG Tue Jan 25 10:17:38 2011 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 22FD7106564A; Tue, 25 Jan 2011 10:17:38 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 1213E8FC14; Tue, 25 Jan 2011 10:17:38 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0PAHbgr025640; Tue, 25 Jan 2011 10:17:37 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0PAHbh9025638; Tue, 25 Jan 2011 10:17:37 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201101251017.p0PAHbh9025638@svn.freebsd.org> From: Konstantin Belousov Date: Tue, 25 Jan 2011 10:17:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r217817 - stable/8/sys/amd64/amd64 X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 25 Jan 2011 10:17:38 -0000 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); }