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 <[EMAIL PROTECTED]>
---

 Applies to kexec-tools-testing 40f4b56e54c3e42ef32189682a85bcdc1bf240f1.

 kexec/arch/ia64/kexec-ia64.c |    1 +
 1 file changed, 1 insertion(+)

--- 0001/kexec/arch/ia64/kexec-ia64.c
+++ work/kexec/arch/ia64/kexec-ia64.c   2007-02-15 19:19:03.000000000 +0900
@@ -90,6 +90,7 @@ int get_memory_ranges(struct memory_rang
        }
 
        /* allocate memory_range dynamically */
+       max_memory_ranges = 0;
        while(fgets(line, sizeof(line), fp) != 0) {
                max_memory_ranges++;
        }
_______________________________________________
fastboot mailing list
[email protected]
https://lists.osdl.org/mailman/listinfo/fastboot

Reply via email to