summaryrefslogtreecommitdiff
path: root/arch/x86/lib/relocate.c
diff options
context:
space:
mode:
authorDuncan Laurie <dlaurie@chromium.org>2012-10-23 18:04:43 +0000
committerSimon Glass <sjg@chromium.org>2012-12-06 14:30:40 -0800
commit0c3929092d13cf12d6b9383f057e663b6334ee04 (patch)
tree898b5f0865d20b308db69354c021abc547d13e9f /arch/x86/lib/relocate.c
parent984d8b09fb3c0ebe97931e6b36ac39bed106ce09 (diff)
downloadu-boot-imx-0c3929092d13cf12d6b9383f057e663b6334ee04.zip
u-boot-imx-0c3929092d13cf12d6b9383f057e663b6334ee04.tar.gz
u-boot-imx-0c3929092d13cf12d6b9383f057e663b6334ee04.tar.bz2
x86: Fix off-by-one error in do_elf_reloc_fixups()
The use of post-increment with a do-while loop results in the loop going one step too far when handling relocation fixups. In about 1/100 cases this would cause it to hang. Signed-off-by: Duncan Laurie <dlaurie@chromium.org> Signed-off-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'arch/x86/lib/relocate.c')
-rw-r--r--arch/x86/lib/relocate.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/arch/x86/lib/relocate.c b/arch/x86/lib/relocate.c
index 200baab..c0b9b29 100644
--- a/arch/x86/lib/relocate.c
+++ b/arch/x86/lib/relocate.c
@@ -85,7 +85,7 @@ int do_elf_reloc_fixups(void)
*offset_ptr_ram += gd->reloc_off;
}
}
- } while (re_src++ < re_end);
+ } while (++re_src < re_end);
return 0;
}