diff options
author | Tang Bin <tangbin@cmss.chinamobile.com> | 2022-09-13 09:37:00 +0300 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2022-12-31 15:32:04 +0300 |
commit | a5514f2f83a1a36e698c4bfdc25875ba0e3b5b5d (patch) | |
tree | f7921fec6a2a7511a71afb3127df0e6dd90a79c3 | |
parent | 0a132a42b77ff0cd12ef9b6efb2d7dab4f6ffc12 (diff) | |
download | linux-a5514f2f83a1a36e698c4bfdc25875ba0e3b5b5d.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>
-rw-r--r-- | drivers/media/platform/qcom/venus/pm_helpers.c | 4 |
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 c93d2906e4c7..48c9084bb4db 100644 --- a/drivers/media/platform/qcom/venus/pm_helpers.c +++ b/drivers/media/platform/qcom/venus/pm_helpers.c @@ -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; } |