diff options
author | Anup Patel <anup.patel@wdc.com> | 2021-04-22 17:12:26 +0530 |
---|---|---|
committer | Anup Patel <anup@brainfault.org> | 2021-04-24 13:05:09 +0530 |
commit | 0d56293817315073b2b07471d5889a5bdf6550ee (patch) | |
tree | 51ee8fcca174748cd4c937e708a069087be2edb7 /lib | |
parent | 49e422c5ad7abee9be0bb1066b1db65676e61985 (diff) | |
download | opensbi-0d56293817315073b2b07471d5889a5bdf6550ee.zip opensbi-0d56293817315073b2b07471d5889a5bdf6550ee.tar.gz opensbi-0d56293817315073b2b07471d5889a5bdf6550ee.tar.bz2 |
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>
Diffstat (limited to 'lib')
-rw-r--r-- | lib/sbi/sbi_domain.c | 1 |
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); |