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>
This commit is contained in:
Pavankumar Kondeti 2021-09-30 15:39:08 +05:30 коммит произвёл Viresh Kumar
Родитель 6880fa6c56
Коммит 8b7912f4cb
1 изменённых файлов: 1 добавлений и 1 удалений

Просмотреть файл

@ -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),