summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMagnus Damm <magnus@valinux.co.jp>2007-02-15 19:39:41 +0900
committerSimon Horman <horms@verge.net.au>2007-02-16 17:55:16 +0900
commitd869eec86724069242679e458a0a24b8274d1cc4 (patch)
tree45fdef92ba3802d58b658f71fcec29f365bab194
parentf09cb6fb977e58e77054107e1df908bb18b92e86 (diff)
Make sure max_memory_ranges are cleared before incremented
Make sure max_memory_ranges are cleared before incremented I happened to call get_memory_ranges() twice on ia64 while debugging some kdump issue the other day. This did not work as expected because the variable max_memory_ranges was not cleared before being incremented. So the second caller gets more ranges than needed. This is normally not a problem - get_memory_ranges() is only called once - but I think it is good coding practice to start from a known state. Signed-off-by: Magnus Damm <magnus@valinux.co.jp> Signed-off-by: Simon Horman <horms@verge.net.au>
-rw-r--r--kexec/arch/ia64/kexec-ia64.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/kexec/arch/ia64/kexec-ia64.c b/kexec/arch/ia64/kexec-ia64.c
index 87c7c8b..bb9bdbb 100644
--- a/kexec/arch/ia64/kexec-ia64.c
+++ b/kexec/arch/ia64/kexec-ia64.c
@@ -90,6 +90,7 @@ int get_memory_ranges(struct memory_range **range, int *ranges,
}
/* allocate memory_range dynamically */
+ max_memory_ranges = 0;
while(fgets(line, sizeof(line), fp) != 0) {
max_memory_ranges++;
}