From owner-svn-src-head@freebsd.org Sun Mar 12 13:49:43 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CC3C2D09025; Sun, 12 Mar 2017 13:49:43 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::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 9BFF816F3; Sun, 12 Mar 2017 13:49:43 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v2CDngSP070871; Sun, 12 Mar 2017 13:49:42 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v2CDng6r070870; Sun, 12 Mar 2017 13:49:42 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201703121349.v2CDng6r070870@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Sun, 12 Mar 2017 13:49:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r315156 - head/sys/kern X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 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: Sun, 12 Mar 2017 13:49:43 -0000 Author: kib Date: Sun Mar 12 13:49:42 2017 New Revision: 315156 URL: https://svnweb.freebsd.org/changeset/base/315156 Log: Style. Sponsored by: The FreeBSD Foundation MFC after: 1 week Modified: head/sys/kern/imgact_elf.c Modified: head/sys/kern/imgact_elf.c ============================================================================== --- head/sys/kern/imgact_elf.c Sun Mar 12 13:48:24 2017 (r315155) +++ head/sys/kern/imgact_elf.c Sun Mar 12 13:49:42 2017 (r315156) @@ -508,7 +508,7 @@ __elfN(load_section)(struct image_params size_t map_len; vm_map_t map; vm_object_t object; - vm_offset_t map_addr; + vm_offset_t off, map_addr; int error, rv, cow; size_t copy_len; vm_ooffset_t file_addr; @@ -559,9 +559,8 @@ __elfN(load_section)(struct image_params return (EINVAL); /* we can stop now if we've covered it all */ - if (memsz == filsz) { + if (memsz == filsz) return (0); - } } @@ -580,14 +579,11 @@ __elfN(load_section)(struct image_params if (map_len != 0) { rv = __elfN(map_insert)(imgp, map, NULL, 0, map_addr, map_addr + map_len, VM_PROT_ALL, 0); - if (rv != KERN_SUCCESS) { + if (rv != KERN_SUCCESS) return (EINVAL); - } } if (copy_len != 0) { - vm_offset_t off; - sf = vm_imgact_map_page(object, offset + filsz); if (sf == NULL) return (EIO); @@ -598,14 +594,12 @@ __elfN(load_section)(struct image_params error = copyout((caddr_t)sf_buf_kva(sf) + off, (caddr_t)map_addr, copy_len); vm_imgact_unmap_page(sf); - if (error) { + if (error != 0) return (error); - } } /* * set it to the specified protection. - * XXX had better undo the damage from pasting over the cracks here! */ vm_map_protect(map, trunc_page(map_addr), round_page(map_addr + map_len), prot, FALSE);