Commit 8b7912f4 authored by Pavankumar Kondeti's avatar Pavankumar Kondeti Committed by Viresh Kumar
Browse files

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: default avatarPavankumar Kondeti <pkondeti@codeaurora.org>
Signed-off-by: default avatarViresh Kumar <viresh.kumar@linaro.org>
parent 6880fa6c
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -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),