Skip to content

Commit

Permalink
avr32: fix relocation check for signed 18-bit offset
Browse files Browse the repository at this point in the history
Caught by static code analysis by David.

Reported-by: David Binderman <dcb314@hotmail.com>
Signed-off-by: Hans-Christian Egtvedt <egtvedt@samfundet.no>
Cc: stable@kernel.org
  • Loading branch information
Hans-Christian Egtvedt committed May 13, 2013
1 parent d6ffe1b commit e68c636
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion arch/avr32/kernel/module.c
Original file line number Diff line number Diff line change
Expand Up @@ -264,7 +264,7 @@ int apply_relocate_add(Elf32_Shdr *sechdrs, const char *strtab,
break;
case R_AVR32_GOT18SW:
if ((relocation & 0xfffe0003) != 0
&& (relocation & 0xfffc0003) != 0xffff0000)
&& (relocation & 0xfffc0000) != 0xfffc0000)
return reloc_overflow(module, "R_AVR32_GOT18SW",
relocation);
relocation >>= 2;
Expand Down

0 comments on commit e68c636

Please sign in to comment.