aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/opp
diff options
context:
space:
mode:
authorPavankumar Kondeti <pkondeti@codeaurora.org>2021-09-30 15:39:08 +0530
committerViresh Kumar <viresh.kumar@linaro.org>2021-10-04 12:23:09 +0530
commit8b7912f4cb6c29a1223ca7f2472bf12c44cc285e (patch)
tree06be294c1198715bba0bf15054215d28882ae435 /drivers/opp
parentLinux 5.15-rc1 (diff)
downloadlinux-dev-8b7912f4cb6c29a1223ca7f2472bf12c44cc285e.tar.xz
linux-dev-8b7912f4cb6c29a1223ca7f2472bf12c44cc285e.zip
opp: Fix required-opps phandle array count check
The 'required-opps' property is optional. So of_count_phandle_with_args() can return -ENOENT when queried for required-opps. Handle this case. Signed-off-by: Pavankumar Kondeti <pkondeti@codeaurora.org> Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
Diffstat (limited to 'drivers/opp')
-rw-r--r--drivers/opp/of.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/opp/of.c b/drivers/opp/of.c
index 2a97c6535c4c..5437085fb380 100644
--- a/drivers/opp/of.c
+++ b/drivers/opp/of.c
@@ -170,7 +170,7 @@ static void _opp_table_alloc_required_tables(struct opp_table *opp_table,
}
count = of_count_phandle_with_args(np, "required-opps", NULL);
- if (!count)
+ if (count <= 0)
goto put_np;
required_opp_tables = kcalloc(count, sizeof(*required_opp_tables),