Commit a4bcfe94 authored by Nicolas Le Bayon's avatar Nicolas Le Bayon Committed by Yann Gautier
Browse files

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: default avatarNicolas Le Bayon <nicolas.le.bayon@st.com>
Signed-off-by: default avatarYann Gautier <yann.gautier@st.com>
parent 42822844
...@@ -121,6 +121,9 @@ int dt_pmic_configure_boot_on_regulators(void) ...@@ -121,6 +121,9 @@ int dt_pmic_configure_boot_on_regulators(void)
} }
regulators_node = fdt_subnode_offset(fdt, pmic_node, "regulators"); regulators_node = fdt_subnode_offset(fdt, pmic_node, "regulators");
if (regulators_node < 0) {
return -ENOENT;
}
fdt_for_each_subnode(regulator_node, fdt, regulators_node) { fdt_for_each_subnode(regulator_node, fdt, regulators_node) {
const fdt32_t *cuint; const fdt32_t *cuint;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment