Remove a redundant offset computation in elf_load_section().

With r344705 the offset is always zero.

Submitted by:	Wuyang Chung <wuyang.chung1@gmail.com>
This commit is contained in:
Mark Johnston 2019-07-24 15:18:05 +00:00
parent 776e56611b
commit e020a35f5b
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=350292

View File

@ -550,7 +550,7 @@ __elfN(load_section)(struct image_params *imgp, vm_ooffset_t offset,
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_ooffset_t offset,
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);