diff options
author | Simon Horman <horms@verge.net.au> | 2010-02-02 14:42:02 +1100 |
---|---|---|
committer | Simon Horman <horms@verge.net.au> | 2010-02-02 14:42:02 +1100 |
commit | 3d6c264eaa4be13208905867e31320ddc30471ae (patch) | |
tree | dbafb986f39f40c6df88ae4b43f33fedc20eb0b7 /kexec/arch/ia64/kexec-ia64.c | |
parent | 48f3ad610b7098659064801f8dc9688e8795a42d (diff) |
Avoid possible overflows from signed/unsigned comparisons
Signed-off-by: Simon Horman <horms@verge.net.au>
Diffstat (limited to 'kexec/arch/ia64/kexec-ia64.c')
-rw-r--r-- | kexec/arch/ia64/kexec-ia64.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/kexec/arch/ia64/kexec-ia64.c b/kexec/arch/ia64/kexec-ia64.c index 657a6b7..450931c 100644 --- a/kexec/arch/ia64/kexec-ia64.c +++ b/kexec/arch/ia64/kexec-ia64.c @@ -101,7 +101,7 @@ int get_memory_ranges(struct memory_range **range, int *ranges, while(fgets(line, sizeof(line), fp) != 0) { unsigned long start, end; char *str; - int type; + unsigned type; int consumed; int count; if (memory_ranges >= max_memory_ranges) @@ -219,13 +219,14 @@ int arch_compat_trampoline(struct kexec_info *UNUSED(info)) int update_loaded_segments(struct mem_ehdr *ehdr) { int i; + unsigned u; struct mem_phdr *phdr; unsigned long start_addr = ULONG_MAX, end_addr = 0; unsigned long align = 1UL<<26; /* 64M */ unsigned long start, end; - for (i = 0; i < ehdr->e_phnum; i++) { - phdr = &ehdr->e_phdr[i]; + for (u = 0; u < ehdr->e_phnum; u++) { + phdr = &ehdr->e_phdr[u]; if (phdr->p_type != PT_LOAD) continue; if (phdr->p_paddr < start_addr) |