]> asedeno.scripts.mit.edu Git - linux.git/commit
drm/msm/a6xx: Avoid freeing gmu resources multiple times
authorSean Paul <seanpaul@chromium.org>
Thu, 23 May 2019 17:16:40 +0000 (13:16 -0400)
committerSean Paul <seanpaul@chromium.org>
Fri, 24 May 2019 13:52:40 +0000 (09:52 -0400)
commit606ec90fc2266284f584a96ebf7f874589f56251
tree45f6119c801279c24d5f95a9b93e99ea21e5214a
parenta188339ca5a396acc588e5851ed7e19f66b0ebd9
drm/msm/a6xx: Avoid freeing gmu resources multiple times

The driver checks for gmu->mmio as a sign that the device has been
initialized, however there are failures in probe below the mmio init.
If one of those is hit, mmio will be non-null but freed.

In that case, a6xx_gmu_probe will return an error to a6xx_gpu_init which
will in turn call a6xx_gmu_remove which checks gmu->mmio and tries to free
resources for a second time. This causes a great boom.

Fix this by adding an initialized member to gmu which is set on
successful probe and cleared on removal.

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-1-sean@poorly.run
drivers/gpu/drm/msm/adreno/a6xx_gmu.c
drivers/gpu/drm/msm/adreno/a6xx_gmu.h