fconf: spm: minor bug fix
This patch fixes a bug where wrong panic was caused when the number of SP was same as max limit. Signed-off-by: Manish Pandey <manish.pandey2@arm.com> Change-Id: I9ace62d8d5bcdc410eeacdd9d33d55a7be5fcc8e
This commit is contained in:
parent
1056ddce76
commit
bef0192a2e
|
@ -45,6 +45,11 @@ int fconf_populate_arm_sp(uintptr_t config)
|
||||||
}
|
}
|
||||||
|
|
||||||
fdt_for_each_subnode(sp_node, dtb, node) {
|
fdt_for_each_subnode(sp_node, dtb, node) {
|
||||||
|
if (index == MAX_SP_IDS) {
|
||||||
|
ERROR("FCONF: Reached max number of SPs\n");
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
err = fdt_read_uint32_array(dtb, sp_node, "uuid", 4,
|
err = fdt_read_uint32_array(dtb, sp_node, "uuid", 4,
|
||||||
uuid_helper.word);
|
uuid_helper.word);
|
||||||
if (err < 0) {
|
if (err < 0) {
|
||||||
|
@ -87,15 +92,10 @@ int fconf_populate_arm_sp(uintptr_t config)
|
||||||
policies[sp_start_index + index].check = open_fip;
|
policies[sp_start_index + index].check = open_fip;
|
||||||
|
|
||||||
index++;
|
index++;
|
||||||
|
|
||||||
if (index >= MAX_SP_IDS) {
|
|
||||||
ERROR("FCONF: reached max number of SPs\n");
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((sp_node < 0) && (sp_node != -FDT_ERR_NOTFOUND)) {
|
if ((sp_node < 0) && (sp_node != -FDT_ERR_NOTFOUND)) {
|
||||||
ERROR("%d: fdt_for_each_subnode(): %d\n", __LINE__, node);
|
ERROR("%u: fdt_for_each_subnode(): %d\n", __LINE__, node);
|
||||||
return sp_node;
|
return sp_node;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue