diff options
| author | Nicholas Kazlauskas <[email protected]> | 2019-01-28 14:00:52 +0000 |
|---|---|---|
| committer | Alex Deucher <[email protected]> | 2019-01-28 16:45:24 +0000 |
| commit | 4b5105036afbd21fb810d3f1528f9a26ef3eea7e (patch) | |
| tree | a7496b7d0d4fb96fd50bb55818cf35bd30603910 /drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | |
| parent | drm/amd/display: Add Vline1 interrupt source to InterruptManager (diff) | |
| download | kernel-4b5105036afbd21fb810d3f1528f9a26ef3eea7e.tar.gz kernel-4b5105036afbd21fb810d3f1528f9a26ef3eea7e.zip | |
drm/amd/display: Don't leak memory when updating streams
[Why]
The flip and full structures were allocated but never freed.
[How]
Free them at the end of the function. There's a small behavioral
change here with the function returning early if the allocation fails
but we wouldn't should be doing anything in that case anyway.
Fixes: c00e0cc0fdc0 ("drm/amd/display: Call into DC once per multiplane flip")
Fixes: ea39594e0855 ("drm/amd/display: Perform plane updates only when needed")
Signed-off-by: Nicholas Kazlauskas <[email protected]>
Reviewed-by: Leo Li <[email protected]>
Tested-by: Michel Dänzer <[email protected]>
Reviewed-by: Harry Wentland <[email protected]>
Signed-off-by: Alex Deucher <[email protected]>
Diffstat (limited to 'drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c')
| -rw-r--r-- | drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 8 |
1 files changed, 7 insertions, 1 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 a247cb19077c..1923f47d3dd6 100644 --- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c @@ -4658,8 +4658,10 @@ static void amdgpu_dm_commit_planes(struct drm_atomic_state *state, flip = kzalloc(sizeof(*flip), GFP_KERNEL); full = kzalloc(sizeof(*full), GFP_KERNEL); - if (!flip || !full) + if (!flip || !full) { dm_error("Failed to allocate update bundles\n"); + goto cleanup; + } /* update planes when needed */ for_each_oldnew_plane_in_state(state, plane, old_plane_state, new_plane_state, i) { @@ -4883,6 +4885,10 @@ static void amdgpu_dm_commit_planes(struct drm_atomic_state *state, dc_state); mutex_unlock(&dm->dc_lock); } + +cleanup: + kfree(flip); + kfree(full); } /* |
