summaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorSivapiriyanKumarasamy <sivapiriyan.kumarasamy@amd.com>2018-08-15 22:55:18 +0200
committerAlex Deucher <alexander.deucher@amd.com>2018-08-27 21:53:37 +0200
commite7603dadd3cc2fa65924d9e8ce0c6f2964866da0 (patch)
tree9fb7a761440f8d39d8ac10be305f2745df879968 /drivers
parentdrm/amdgpu: fix holding mn_lock while allocating memory (diff)
downloadlinux-e7603dadd3cc2fa65924d9e8ce0c6f2964866da0.tar.xz
linux-e7603dadd3cc2fa65924d9e8ce0c6f2964866da0.zip
drm/amd/display: Fix memory leak caused by missed dc_sink_release
[Why] There is currently an intermittent hang from a memory leak in DTN stress testing. It is caused by unfreed memory during driver disable. [How] Do a dc_sink_release in the case that skips it incorrectly. Signed-off-by: SivapiriyanKumarasamy <sivapiriyan.kumarasamy@amd.com> Reviewed-by: Aric Cyr <Aric.Cyr@amd.com> Acked-by: Leo Li <sunpeng.li@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/gpu/drm/amd/display/dc/core/dc_link.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/drivers/gpu/drm/amd/display/dc/core/dc_link.c b/drivers/gpu/drm/amd/display/dc/core/dc_link.c
index 567867915d32..37eaf72ace54 100644
--- a/drivers/gpu/drm/amd/display/dc/core/dc_link.c
+++ b/drivers/gpu/drm/amd/display/dc/core/dc_link.c
@@ -754,8 +754,12 @@ bool dc_link_detect(struct dc_link *link, enum dc_detect_reason reason)
* fail-safe mode
*/
if (dc_is_hdmi_signal(link->connector_signal) ||
- dc_is_dvi_signal(link->connector_signal))
+ dc_is_dvi_signal(link->connector_signal)) {
+ if (prev_sink != NULL)
+ dc_sink_release(prev_sink);
+
return false;
+ }
default:
break;
}