diff options
author | Leo (Sunpeng) Li <sunpeng.li@amd.com> | 2018-05-16 10:31:30 -0400 |
---|---|---|
committer | Alex Deucher <alexander.deucher@amd.com> | 2018-05-29 13:27:32 -0500 |
commit | df099b9b60c6c378b1cd2024d1a21a87459b6614 (patch) | |
tree | 3feb6a82f206a21f1615bc95a0795971610a9f11 /drivers/gpu/drm/amd | |
parent | aa6d4a59d686d3172012c19874add120e02c113f (diff) | |
download | linux-df099b9b60c6c378b1cd2024d1a21a87459b6614.tar.gz linux-df099b9b60c6c378b1cd2024d1a21a87459b6614.tar.bz2 linux-df099b9b60c6c378b1cd2024d1a21a87459b6614.zip |
drm/amd/display: Destroy connector state on reset
When a DRM mode reset is called on resume, the connector state's
destructor is not called. This leaves a dangling reference on the CRTC
commit object, which was obtained by the connector state during commit
setup.
Signed-off-by: Leo (Sunpeng) Li <sunpeng.li@amd.com>
Reviewed-by: Harry Wentland <Harry.Wentland@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'drivers/gpu/drm/amd')
-rw-r--r-- | drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c index e2bf4fee4eb2..d913c0a029f2 100644 --- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c @@ -2709,6 +2709,9 @@ void amdgpu_dm_connector_funcs_reset(struct drm_connector *connector) struct dm_connector_state *state = to_dm_connector_state(connector->state); + if (connector->state) + __drm_atomic_helper_connector_destroy_state(connector->state); + kfree(state); state = kzalloc(sizeof(*state), GFP_KERNEL); @@ -2719,8 +2722,7 @@ void amdgpu_dm_connector_funcs_reset(struct drm_connector *connector) state->underscan_hborder = 0; state->underscan_vborder = 0; - connector->state = &state->base; - connector->state->connector = connector; + __drm_atomic_helper_connector_reset(connector, &state->base); } } |