avr32: fix relocation check for signed 18-bit offset
authorHans-Christian Egtvedt <egtvedt@samfundet.no>
Mon, 13 May 2013 20:22:10 +0000 (22:22 +0200)
committerHans-Christian Egtvedt <egtvedt@samfundet.no>
Mon, 13 May 2013 20:22:10 +0000 (22:22 +0200)
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
arch/avr32/kernel/module.c

index 596f7305d93f017c43af7fc5f965ea4d0b988246..2c9412908024d4ce88d8945cf953b0d24437dcaf 100644 (file)
@@ -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;