mirror of
git://git.yoctoproject.org/linux-yocto.git
synced 2025-10-22 23:13:01 +02:00
binfmt_elf_fdpic: fix variable set but not used warning
Fix below kernel warning: fs/binfmt_elf_fdpic.c:1024:52: warning: variable 'excess1' set but not used [-Wunused-but-set-variable] Reported-by: kernel test robot <lkp@intel.com> Signed-off-by: sunliming <sunliming@kylinos.cn> Reviewed-by: Jan Kara <jack@suse.cz> Link: https://lore.kernel.org/r/20250308022754.75013-1-sunliming@linux.dev Signed-off-by: Kees Cook <kees@kernel.org>
This commit is contained in:
parent
b0db1ed176
commit
8d68cabeb1
|
@ -1024,7 +1024,7 @@ static int elf_fdpic_map_file_by_direct_mmap(struct elf_fdpic_params *params,
|
||||||
/* deal with each load segment separately */
|
/* deal with each load segment separately */
|
||||||
phdr = params->phdrs;
|
phdr = params->phdrs;
|
||||||
for (loop = 0; loop < params->hdr.e_phnum; loop++, phdr++) {
|
for (loop = 0; loop < params->hdr.e_phnum; loop++, phdr++) {
|
||||||
unsigned long maddr, disp, excess, excess1;
|
unsigned long maddr, disp, excess;
|
||||||
int prot = 0, flags;
|
int prot = 0, flags;
|
||||||
|
|
||||||
if (phdr->p_type != PT_LOAD)
|
if (phdr->p_type != PT_LOAD)
|
||||||
|
@ -1120,9 +1120,10 @@ static int elf_fdpic_map_file_by_direct_mmap(struct elf_fdpic_params *params,
|
||||||
* extant in the file
|
* extant in the file
|
||||||
*/
|
*/
|
||||||
excess = phdr->p_memsz - phdr->p_filesz;
|
excess = phdr->p_memsz - phdr->p_filesz;
|
||||||
excess1 = PAGE_SIZE - ((maddr + phdr->p_filesz) & ~PAGE_MASK);
|
|
||||||
|
|
||||||
#ifdef CONFIG_MMU
|
#ifdef CONFIG_MMU
|
||||||
|
unsigned long excess1
|
||||||
|
= PAGE_SIZE - ((maddr + phdr->p_filesz) & ~PAGE_MASK);
|
||||||
if (excess > excess1) {
|
if (excess > excess1) {
|
||||||
unsigned long xaddr = maddr + phdr->p_filesz + excess1;
|
unsigned long xaddr = maddr + phdr->p_filesz + excess1;
|
||||||
unsigned long xmaddr;
|
unsigned long xmaddr;
|
||||||
|
|
Loading…
Reference in New Issue
Block a user