summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHarry Wentland <harry.wentland@amd.com>2017-04-18 15:43:22 -0400
committerHarry Wentland <harry.wentland@amd.com>2017-05-03 16:46:58 -0400
commit0e794cbeb0407adf922c3d089d5a69999377dbb3 (patch)
tree3d9e4bdc381bf40c286a23fc5903c53f906cb670
parentb2859eb4fd9625536f70ebd340a87253dcadad6f (diff)
drm/amd/display: Fix memory leak in post_update_surfaces
Signed-off-by: Harry Wentland <harry.wentland@amd.com> Acked-by: Harry Wentland <Harry.Wentland@amd.com> Reviewed-by: Tony Cheng <Tony.Cheng@amd.com>
-rw-r--r--drivers/gpu/drm/amd/display/dc/core/dc.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/drivers/gpu/drm/amd/display/dc/core/dc.c b/drivers/gpu/drm/amd/display/dc/core/dc.c
index 64b5216fb920..b1f0a50171af 100644
--- a/drivers/gpu/drm/amd/display/dc/core/dc.c
+++ b/drivers/gpu/drm/amd/display/dc/core/dc.c
@@ -918,6 +918,7 @@ bool dc_post_update_surfaces_to_stream(struct dc *dc)
int i;
struct core_dc *core_dc = DC_TO_CORE(dc);
struct validate_context *context = dm_alloc(sizeof(struct validate_context));
+ bool result = true;
if (!context) {
dm_error("%s: failed to create validate ctx\n", __func__);
@@ -935,17 +936,19 @@ bool dc_post_update_surfaces_to_stream(struct dc *dc)
if (!core_dc->res_pool->funcs->validate_bandwidth(core_dc, context)) {
BREAK_TO_DEBUGGER();
- return false;
+ result = false;
+ goto cleanup;
}
core_dc->hwss.set_bandwidth(core_dc, context, true);
dc_resource_validate_ctx_copy_construct(context, core_dc->current_context);
+cleanup:
dc_resource_validate_ctx_destruct(context);
dm_free(context);
- return true;
+ return result;
}
bool dc_commit_surfaces_to_stream(