From owner-svn-src-all@FreeBSD.ORG Sun Jun 22 08:32:32 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 35CF3FEA; Sun, 22 Jun 2014 08:32:32 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 08C67211E; Sun, 22 Jun 2014 08:32:32 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s5M8WVAw012039; Sun, 22 Jun 2014 08:32:31 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s5M8WV4k012038; Sun, 22 Jun 2014 08:32:31 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201406220832.s5M8WV4k012038@svn.freebsd.org> From: Konstantin Belousov Date: Sun, 22 Jun 2014 08:32:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r267714 - stable/10/sys/i386/i386 X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 22 Jun 2014 08:32:32 -0000 Author: kib Date: Sun Jun 22 08:32:31 2014 New Revision: 267714 URL: http://svnweb.freebsd.org/changeset/base/267714 Log: MFC r267492: Fix some cosmetic issues with the use of kmem_malloc() in the i386 LDT sysarch(2) code. Modified: stable/10/sys/i386/i386/sys_machdep.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/i386/i386/sys_machdep.c ============================================================================== --- stable/10/sys/i386/i386/sys_machdep.c Sun Jun 22 08:30:43 2014 (r267713) +++ stable/10/sys/i386/i386/sys_machdep.c Sun Jun 22 08:32:31 2014 (r267714) @@ -164,19 +164,14 @@ sysarch(td, uap) break; case I386_SET_LDT: if (kargs.largs.descs != NULL) { - lp = (union descriptor *)kmem_malloc(kernel_arena, + lp = (union descriptor *)malloc( kargs.largs.num * sizeof(union descriptor), - M_WAITOK); - if (lp == NULL) { - error = ENOMEM; - break; - } + M_TEMP, M_WAITOK); error = copyin(kargs.largs.descs, lp, kargs.largs.num * sizeof(union descriptor)); if (error == 0) error = i386_set_ldt(td, &kargs.largs, lp); - kmem_free(kernel_arena, (vm_offset_t)lp, - kargs.largs.num * sizeof(union descriptor)); + free(lp, M_TEMP); } else { error = i386_set_ldt(td, &kargs.largs, NULL); } @@ -300,10 +295,7 @@ i386_extend_pcb(struct thread *td) }; ext = (struct pcb_ext *)kmem_malloc(kernel_arena, ctob(IOPAGES+1), - M_WAITOK); - if (ext == 0) - return (ENOMEM); - bzero(ext, sizeof(struct pcb_ext)); + M_WAITOK | M_ZERO); /* -16 is so we can convert a trapframe into vm86trapframe inplace */ ext->ext_tss.tss_esp0 = td->td_kstack + ctob(KSTACK_PAGES) - sizeof(struct pcb) - 16; @@ -474,12 +466,7 @@ user_ldt_alloc(struct mdproc *mdp, int l new_ldt->ldt_len = len = NEW_MAX_LD(len); new_ldt->ldt_base = (caddr_t)kmem_malloc(kernel_arena, - round_page(len * sizeof(union descriptor)), M_WAITOK); - if (new_ldt->ldt_base == NULL) { - free(new_ldt, M_SUBPROC); - mtx_lock_spin(&dt_lock); - return (NULL); - } + round_page(len * sizeof(union descriptor)), M_WAITOK); new_ldt->ldt_refcnt = 1; new_ldt->ldt_active = 0; @@ -514,12 +501,7 @@ user_ldt_alloc(struct mdproc *mdp, int l new_ldt->ldt_len = len = NEW_MAX_LD(len); new_ldt->ldt_base = (caddr_t)kmem_malloc(kernel_arena, - len * sizeof(union descriptor), M_WAITOK); - if (new_ldt->ldt_base == NULL) { - free(new_ldt, M_SUBPROC); - mtx_lock_spin(&dt_lock); - return (NULL); - } + len * sizeof(union descriptor), M_WAITOK); new_ldt->ldt_refcnt = 1; new_ldt->ldt_active = 0;