]> git.hungrycats.org Git - linux/commitdiff
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)
committerBen Hutchings <ben@decadent.org.uk>
Thu, 30 May 2013 13:34:58 +0000 (14:34 +0100)
commit e68c636d88db3fda74e664ecb1a213ae0d50a7d8 upstream.

Caught by static code analysis by David.

Reported-by: David Binderman <dcb314@hotmail.com>
Signed-off-by: Hans-Christian Egtvedt <egtvedt@samfundet.no>
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
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;