Skip to content

Commit 8b7912f

Browse files
Pavankumar Kondetivireshk
authored andcommitted
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 <[email protected]> Signed-off-by: Viresh Kumar <[email protected]>
1 parent 6880fa6 commit 8b7912f

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/opp/of.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,7 @@ static void _opp_table_alloc_required_tables(struct opp_table *opp_table,
170170
}
171171

172172
count = of_count_phandle_with_args(np, "required-opps", NULL);
173-
if (!count)
173+
if (count <= 0)
174174
goto put_np;
175175

176176
required_opp_tables = kcalloc(count, sizeof(*required_opp_tables),

0 commit comments

Comments
 (0)