summaryrefslogtreecommitdiff
path: root/drivers/gpu/drm
diff options
context:
space:
mode:
authorSean Paul <seanpaul@chromium.org>2019-05-23 13:16:42 -0400
committerSean Paul <seanpaul@chromium.org>2019-05-24 09:53:20 -0400
commit5ca4a094ba7e1369363dcbcbde8baf06ddcdc2d1 (patch)
tree3b1a71346097d80bcf7bbeef16f31971f4286d80 /drivers/gpu/drm
parentcfcb365861b77389f7fbc9c8153a08c62ae390af (diff)
drm/msm/a6xx: Check for ERR or NULL before iounmap
pdcptr and seqptr aren't necessarily valid, check them before trying to unmap them. Changes in v2: - None Cc: Jordan Crouse <jcrouse@codeaurora.org> Reviewed-by: Jordan Crouse <jcrouse@codeaurora.org> Signed-off-by: Sean Paul <seanpaul@chromium.org> Link: https://patchwork.freedesktop.org/patch/msgid/20190523171653.138678-3-sean@poorly.run
Diffstat (limited to 'drivers/gpu/drm')
-rw-r--r--drivers/gpu/drm/msm/adreno/a6xx_gmu.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/drivers/gpu/drm/msm/adreno/a6xx_gmu.c b/drivers/gpu/drm/msm/adreno/a6xx_gmu.c
index 742c8ff9a61c..7465423e9b71 100644
--- a/drivers/gpu/drm/msm/adreno/a6xx_gmu.c
+++ b/drivers/gpu/drm/msm/adreno/a6xx_gmu.c
@@ -504,8 +504,10 @@ static void a6xx_gmu_rpmh_init(struct a6xx_gmu *gmu)
wmb();
err:
- devm_iounmap(gmu->dev, pdcptr);
- devm_iounmap(gmu->dev, seqptr);
+ if (!IS_ERR_OR_NULL(pdcptr))
+ devm_iounmap(gmu->dev, pdcptr);
+ if (!IS_ERR_OR_NULL(seqptr))
+ devm_iounmap(gmu->dev, seqptr);
}
/*