Blob Blame History Raw
From: Andrew Jiang <Andrew.Jiang@amd.com>
Date: Fri, 1 Sep 2017 16:03:16 -0400
Subject: drm/amd/display: Fix context alloc failed logging
Git-commit: aeff7ab11e2516bfa41c77b9ea57bc2c07bb3b62
Patch-mainline: v4.15-rc1
References: FATE#326289 FATE#326079 FATE#326049 FATE#322398 FATE#326166

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: Andrew Jiang <Andrew.Jiang@amd.com>
Reviewed-by: Tony Cheng <Tony.Cheng@amd.com>
Acked-by: Harry Wentland <Harry.Wentland@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Acked-by: Petr Tesarik <ptesarik@suse.com>
---
 drivers/gpu/drm/amd/display/dc/core/dc.c |    9 ++++-----
 1 file changed, 4 insertions(+), 5 deletions(-)

--- a/drivers/gpu/drm/amd/display/dc/core/dc.c
+++ b/drivers/gpu/drm/amd/display/dc/core/dc.c
@@ -1279,8 +1279,10 @@ void dc_update_planes_and_stream(struct
 
 		/* 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
 
 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)