drm/amd/display: add assert in enable FBC
authorRoman Li <[email protected]>
Wed, 14 Mar 2018 22:02:07 +0000 (18:02 -0400)
committerAlex Deucher <[email protected]>
Wed, 11 Apr 2018 18:07:42 +0000 (13:07 -0500)
Adding assert to prevent possible null deref warning.
Only can happen under abnormal circumstances.

Signed-off-by: Roman Li <[email protected]>
Reviewed-by: Tony Cheng <[email protected]>
Acked-by: Harry Wentland <[email protected]>
Signed-off-by: Alex Deucher <[email protected]>
drivers/gpu/drm/amd/display/dc/dce110/dce110_hw_sequencer.c

index daa4673675f16bd3045f2d6d4c85db3c7c139104..075ab291cdc7915df594693d940567814f8f09ae 100644 (file)
@@ -1801,6 +1801,9 @@ static bool should_enable_fbc(struct dc *dc,
                }
        }
 
+       /* Pipe context should be found */
+       ASSERT(pipe_ctx);
+
        /* Only supports eDP */
        if (pipe_ctx->stream->sink->link->connector_signal != SIGNAL_TYPE_EDP)
                return false;