* [PATCH] opp: Fix required-opps phandle array count check
@ 2021-09-30 10:09 Pavankumar Kondeti
2021-10-04 6:53 ` Viresh Kumar
0 siblings, 1 reply; 2+ messages in thread
From: Pavankumar Kondeti @ 2021-09-30 10:09 UTC (permalink / raw)
To: linux-kernel
Cc: linux-pm, Rafael J . Wysocki, Rajendra Nayak, Pavankumar Kondeti,
Viresh Kumar, Nishanth Menon, Stephen Boyd
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>
---
drivers/opp/of.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/opp/of.c b/drivers/opp/of.c
index 2a97c65..5437085 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),
--
Qualcomm India Private Limited, on behalf of Qualcomm Innovation Center, Inc.
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, a Linux Foundation Collaborative Project.
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH] opp: Fix required-opps phandle array count check
2021-09-30 10:09 [PATCH] opp: Fix required-opps phandle array count check Pavankumar Kondeti
@ 2021-10-04 6:53 ` Viresh Kumar
0 siblings, 0 replies; 2+ messages in thread
From: Viresh Kumar @ 2021-10-04 6:53 UTC (permalink / raw)
To: Pavankumar Kondeti
Cc: linux-kernel, linux-pm, Rafael J . Wysocki, Rajendra Nayak,
Viresh Kumar, Nishanth Menon, Stephen Boyd
On 30-09-21, 15:39, Pavankumar Kondeti wrote:
> 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>
> ---
> drivers/opp/of.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/opp/of.c b/drivers/opp/of.c
> index 2a97c65..5437085 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),
Applied. Thanks.
--
viresh
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2021-10-04 6:53 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-09-30 10:09 [PATCH] opp: Fix required-opps phandle array count check Pavankumar Kondeti
2021-10-04 6:53 ` Viresh Kumar
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®