fix(drivers/st/pmic): missing error check

In pmic_operate(), "regulators" node value must be checked before
entering in the fdt_for_each_subnode loop.

Change-Id: I1460cd24ec56ec47ab644f396b71b92973e75fb4
Signed-off-by: Nicolas Le Bayon <nicolas.le.bayon@st.com>
Signed-off-by: Yann Gautier <yann.gautier@st.com>
This commit is contained in:
Nicolas Le Bayon 2020-03-10 18:18:45 +01:00 committed by Yann Gautier
parent 42822844bf
commit a4bcfe94e7
1 changed files with 3 additions and 0 deletions

View File

@ -121,6 +121,9 @@ int dt_pmic_configure_boot_on_regulators(void)
}
regulators_node = fdt_subnode_offset(fdt, pmic_node, "regulators");
if (regulators_node < 0) {
return -ENOENT;
}
fdt_for_each_subnode(regulator_node, fdt, regulators_node) {
const fdt32_t *cuint;