mirror of
https://github.com/riscv-software-src/opensbi.git
synced 2025-08-24 15:31:22 +01:00
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>
This commit is contained in:
@@ -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);
|
||||
|
Reference in New Issue
Block a user