aboutsummaryrefslogtreecommitdiffstats
path: root/src/svm/svm.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/svm/svm.c')
-rw-r--r--src/svm/svm.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/svm/svm.c b/src/svm/svm.c
index 2cbc0d77c22..d3e56c1a46a 100644
--- a/src/svm/svm.c
+++ b/src/svm/svm.c
@@ -76,14 +76,15 @@ svm_get_global_region_base_va ()
unformat_init_clib_file (&input, fd);
while (unformat_check_input (&input) != UNFORMAT_END_OF_INPUT)
{
- unformat (&input, "%llx-%llx", &start, &end);
+ if (unformat (&input, "%llx-%llx", &start, &end))
+ end--;
unformat_skip_line (&input);
}
unformat_free (&input);
close (fd);
count_leading_zeros (bits, end);
- bits = 64 - (bits + 1);
+ bits = 64 - bits;
if (bits >= 36 && bits <= 48)
return ((1ul << bits) / 4) - (2 * SVM_GLOBAL_REGION_SIZE);
else