venus: pm_helpers: Fix error check in vcodec_domains_get()
authorTang Bin <tangbin@cmss.chinamobile.com>
Tue, 13 Sep 2022 06:37:00 +0000 (14:37 +0800)
committerStanimir Varbanov <stanimir.varbanov@linaro.org>
Tue, 25 Oct 2022 07:38:56 +0000 (10:38 +0300)
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>
drivers/media/platform/qcom/venus/pm_helpers.c

index c93d2906e4c7dc23ef964531aa4a8a88f8a68494..48c9084bb4dba82902ddd2b916f3e06e0a527434 100644 (file)
@@ -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;
        }