提交 aeff7ab1 编写于 作者: A Andrew Jiang 提交者: Alex Deucher

drm/amd/display: Fix context alloc failed logging

Since there was no return statement in the fail block immediately
preceding the context_alloc_fail block, any failure within the
function caused a context alloc failed error message to be printed.
Since the context_alloc_fail block is only used once, move it to
where the goto is directly and accompany it with a return statement.
Signed-off-by: NAndrew Jiang <Andrew.Jiang@amd.com>
Reviewed-by: NTony Cheng <Tony.Cheng@amd.com>
Acked-by: NHarry Wentland <Harry.Wentland@amd.com>
Signed-off-by: NAlex Deucher <alexander.deucher@amd.com>
上级 603767f9
......@@ -1279,8 +1279,10 @@ void dc_update_planes_and_stream(struct dc *dc,
/* initialize scratch memory for building context */
context = dc_create_state();
if (context == NULL)
goto context_alloc_fail;
if (context == NULL) {
DC_ERROR("Failed to allocate new validate context!\n");
return;
}
dc_resource_state_copy_construct(
dc->current_state, context);
......@@ -1534,9 +1536,6 @@ void dc_update_planes_and_stream(struct dc *dc,
fail:
dc_release_state(context);
context_alloc_fail:
DC_ERROR("Failed to allocate new validate context!\n");
}
uint8_t dc_get_current_stream_count(struct dc *dc)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册