File s390-tools-sles11sp2-lsmem-chmem-dev_size.patch of Package s390-tools

Description: lsmem/chmem: Fix memory device size calculation
Symptom:     "Illegal division by zero" on systems with <= 256 MB of memory,
             and on systems with > 256 GB of memory.
Problem:     Broken dev_size calculation.
Solution:    Fix dev_size calculation.
Problem-ID:  76149
---
 zconf/chmem |    1 +
 zconf/lsmem |    1 +
 2 files changed, 2 insertions(+)

--- a/zconf/chmem
+++ b/zconf/chmem
@@ -78,6 +78,7 @@ sub chmem_get_dev_size()
 				    ($device - $old_device));
 			last;
 		}
+		$dev_size += $block_size;
 		$old_block = $block;
 	}
 }
--- a/zconf/lsmem
+++ b/zconf/lsmem
@@ -43,6 +43,7 @@ sub lsmem_get_dev_size()
 				    ($device - $old_device));
 			last;
 		}
+		$dev_size += $block_size;
 		$old_block = $block;
 	}
 }