From owner-svn-src-head@FreeBSD.ORG Wed May 27 16:20:47 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 221BE1065678; Wed, 27 May 2009 16:20:47 +0000 (UTC) (envelope-from sson@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 1051A8FC13; Wed, 27 May 2009 16:20:47 +0000 (UTC) (envelope-from sson@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n4RGKktN003134; Wed, 27 May 2009 16:20:46 GMT (envelope-from sson@svn.freebsd.org) Received: (from sson@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n4RGKk9e003133; Wed, 27 May 2009 16:20:46 GMT (envelope-from sson@svn.freebsd.org) Message-Id: <200905271620.n4RGKk9e003133@svn.freebsd.org> From: Stacey Son Date: Wed, 27 May 2009 16:20:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r192902 - head/sys/dev/ksyms X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 27 May 2009 16:20:47 -0000 Author: sson Date: Wed May 27 16:20:46 2009 New Revision: 192902 URL: http://svn.freebsd.org/changeset/base/192902 Log: Change from using vm_map_delete() to vm_map_remove(). Approved by: gnn (mentor) Obtained from: kib Modified: head/sys/dev/ksyms/ksyms.c Modified: head/sys/dev/ksyms/ksyms.c ============================================================================== --- head/sys/dev/ksyms/ksyms.c Wed May 27 16:16:56 2009 (r192901) +++ head/sys/dev/ksyms/ksyms.c Wed May 27 16:20:46 2009 (r192902) @@ -395,29 +395,15 @@ static int ksyms_unmap(struct thread *td, vm_offset_t addr, size_t sz) { vm_map_t map; - int error; vm_size_t size; map = &td->td_proc->p_vmspace->vm_map; - size = (vm_size_t) round_page(sz); - /* check for address wrap-around */ - if (addr + size < addr || addr < vm_map_min(map) || - addr + size > vm_map_max(map)) - return (EINVAL); - - vm_map_lock(map); - /* make sure the pages are mapped */ - if (!vm_map_check_protection(map, addr, addr + size, VM_PROT_NONE)) { - vm_map_unlock(map); + if (!vm_map_remove(map, addr, addr + size)) return (EINVAL); - } - - error = vm_map_delete(map, addr, addr + size); - vm_map_unlock(map); - return (error); + return (0); } static void