svn commit: r350292 - head/sys/kern
Mark Johnston
markj at FreeBSD.org
Wed Jul 24 15:18:06 UTC 2019
Author: markj
Date: Wed Jul 24 15:18:05 2019
New Revision: 350292
URL: https://svnweb.freebsd.org/changeset/base/350292
Log:
Remove a redundant offset computation in elf_load_section().
With r344705 the offset is always zero.
Submitted by: Wuyang Chung <wuyang.chung1 at gmail.com>
Modified:
head/sys/kern/imgact_elf.c
Modified: head/sys/kern/imgact_elf.c
==============================================================================
--- head/sys/kern/imgact_elf.c Wed Jul 24 15:10:09 2019 (r350291)
+++ head/sys/kern/imgact_elf.c Wed Jul 24 15:18:05 2019 (r350292)
@@ -550,7 +550,7 @@ __elfN(load_section)(struct image_params *imgp, vm_oof
size_t map_len;
vm_map_t map;
vm_object_t object;
- vm_offset_t off, map_addr;
+ vm_offset_t map_addr;
int error, rv, cow;
size_t copy_len;
vm_ooffset_t file_addr;
@@ -629,9 +629,8 @@ __elfN(load_section)(struct image_params *imgp, vm_oof
return (EIO);
/* send the page fragment to user space */
- off = trunc_page(offset + filsz) - trunc_page(offset + filsz);
- error = copyout((caddr_t)sf_buf_kva(sf) + off,
- (caddr_t)map_addr, copy_len);
+ error = copyout((caddr_t)sf_buf_kva(sf), (caddr_t)map_addr,
+ copy_len);
vm_imgact_unmap_page(sf);
if (error != 0)
return (error);
More information about the svn-src-all
mailing list