Commit 2b117451 authored by Sean Paul's avatar Sean Paul

drm/msm: Upgrade gxpd checks to IS_ERR_OR_NULL

dev_pm_domain_attach_by_name() can return NULL, so we should check for
that case when we're about to dereference gxpd.

Fixes: 9325d426 ("drm/msm/gpu: Attach to the GPU GX power domain")
Cc: Jordan Crouse <jcrouse@codeaurora.org>
Cc: Rob Clark <robdclark@chromium.org>
Reviewed-by: default avatarJordan Crouse <jcrouse@codeauorora.org>
Signed-off-by: default avatarSean Paul <seanpaul@chromium.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20190515170104.155525-1-sean@poorly.run
parent 26359dc5
...@@ -747,7 +747,7 @@ int a6xx_gmu_resume(struct a6xx_gpu *a6xx_gpu) ...@@ -747,7 +747,7 @@ int a6xx_gmu_resume(struct a6xx_gpu *a6xx_gpu)
* will make sure that the refcounting is correct in case we need to * will make sure that the refcounting is correct in case we need to
* bring down the GX after a GMU failure * bring down the GX after a GMU failure
*/ */
if (!IS_ERR(gmu->gxpd)) if (!IS_ERR_OR_NULL(gmu->gxpd))
pm_runtime_get(gmu->gxpd); pm_runtime_get(gmu->gxpd);
out: out:
...@@ -863,7 +863,7 @@ int a6xx_gmu_stop(struct a6xx_gpu *a6xx_gpu) ...@@ -863,7 +863,7 @@ int a6xx_gmu_stop(struct a6xx_gpu *a6xx_gpu)
* domain. Usually the GMU does this but only if the shutdown sequence * domain. Usually the GMU does this but only if the shutdown sequence
* was successful * was successful
*/ */
if (!IS_ERR(gmu->gxpd)) if (!IS_ERR_OR_NULL(gmu->gxpd))
pm_runtime_put_sync(gmu->gxpd); pm_runtime_put_sync(gmu->gxpd);
clk_bulk_disable_unprepare(gmu->nr_clocks, gmu->clocks); clk_bulk_disable_unprepare(gmu->nr_clocks, gmu->clocks);
...@@ -1234,7 +1234,7 @@ void a6xx_gmu_remove(struct a6xx_gpu *a6xx_gpu) ...@@ -1234,7 +1234,7 @@ void a6xx_gmu_remove(struct a6xx_gpu *a6xx_gpu)
pm_runtime_disable(gmu->dev); pm_runtime_disable(gmu->dev);
if (!IS_ERR(gmu->gxpd)) { if (!IS_ERR_OR_NULL(gmu->gxpd)) {
pm_runtime_disable(gmu->gxpd); pm_runtime_disable(gmu->gxpd);
dev_pm_domain_detach(gmu->gxpd, false); dev_pm_domain_detach(gmu->gxpd, false);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment