summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnup Patel <anup.patel@wdc.com>2021-04-22 14:42:26 +0300
committerAnup Patel <anup@brainfault.org>2021-04-24 10:35:09 +0300
commit0d56293817315073b2b07471d5889a5bdf6550ee (patch)
tree51ee8fcca174748cd4c937e708a069087be2edb7
parent49e422c5ad7abee9be0bb1066b1db65676e61985 (diff)
downloadopensbi-0d56293817315073b2b07471d5889a5bdf6550ee.tar.xz
lib: sbi: Fix sbi_domain_root_add_memregion() for merging memregions
We should decrement root_memregs_count by one after merging two memregions otherwise new memregion added after a merge will be appended after last sentinel memregion of zero order. Signed-off-by: Anup Patel <anup.patel@wdc.com> Reviewed-by: Xiang W <wxjstz@126.com>
-rw-r--r--lib/sbi/sbi_domain.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/lib/sbi/sbi_domain.c b/lib/sbi/sbi_domain.c
index 69a3795..1b2e6e3 100644
--- a/lib/sbi/sbi_domain.c
+++ b/lib/sbi/sbi_domain.c
@@ -521,6 +521,7 @@ int sbi_domain_root_add_memregion(const struct sbi_domain_memregion *reg)
nreg1++;
}
reg_merged = true;
+ root_memregs_count--;
}
}
} while (reg_merged);