summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorTang Bin <tangbin@cmss.chinamobile.com>2022-09-13 09:37:00 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2023-01-14 12:15:24 +0300
commit4882492ad3f08a35fbc4a02a40b416583f0d5056 (patch)
tree9531d713fe942b26c74e0fd0d10761e2aa1d2a07 /drivers
parent86d531c1d7947d5cd845d8b280262ad53fd10cc2 (diff)
downloadlinux-4882492ad3f08a35fbc4a02a40b416583f0d5056.tar.xz
venus: pm_helpers: Fix error check in vcodec_domains_get()
[ Upstream commit 0f6e8d8c94a82e85e1b9b62a7671990740dc6f70 ] 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: 7482a983dea3 ("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>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/media/platform/qcom/venus/pm_helpers.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/media/platform/qcom/venus/pm_helpers.c b/drivers/media/platform/qcom/venus/pm_helpers.c
index 710f9a2b132b..f7de02352f1b 100644
--- a/drivers/media/platform/qcom/venus/pm_helpers.c
+++ b/drivers/media/platform/qcom/venus/pm_helpers.c
@@ -764,8 +764,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;
}