Skip to content

Commit

Permalink
venus: pm_helpers: Fix error check in vcodec_domains_get()
Browse files Browse the repository at this point in the history
[ Upstream commit 0f6e8d8 ]

In the function vcodec_domains_get(), dev_pm_domain_attach_by_name()
may return NULL in some cases, so IS_ERR() doesn't meet the
requirements. Thus fix it.

Fixes: 7482a98 ("media: venus: redesign clocks and pm domains control")
Signed-off-by: Tang Bin <tangbin@cmss.chinamobile.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
  • Loading branch information
Tang Bin authored and gregkh committed Dec 31, 2022
1 parent 0a132a4 commit a5514f2
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions drivers/media/platform/qcom/venus/pm_helpers.c
Original file line number Diff line number Diff line change
Expand Up @@ -869,8 +869,8 @@ static int vcodec_domains_get(struct venus_core *core)
for (i = 0; i < res->vcodec_pmdomains_num; i++) {
pd = dev_pm_domain_attach_by_name(dev,
res->vcodec_pmdomains[i]);
if (IS_ERR(pd))
return PTR_ERR(pd);
if (IS_ERR_OR_NULL(pd))
return PTR_ERR(pd) ? : -ENODATA;
core->pmdomains[i] = pd;
}

Expand Down

0 comments on commit a5514f2

Please sign in to comment.