drm/amd/display: Remove redundant assignment to variable dc
authorYi Yang <yiyang13@huawei.com>
Fri, 16 Dec 2022 10:23:18 +0000 (18:23 +0800)
committerAlex Deucher <alexander.deucher@amd.com>
Mon, 9 Jan 2023 22:02:18 +0000 (17:02 -0500)
Smatch report warning as follows:

Line 53679: drivers/gpu/drm/amd/display/dc/core/dc_stream.c:402
dc_stream_set_cursor_position() warn: variable dereferenced before
check 'stream'

The value of 'dc' has been assigned after check whether 'stream' is
NULL. Fix it by remove redundant assignment.

Reviewed-by: Harry Wentland <harry.wentland@amd.com>
Signed-off-by: Yi Yang <yiyang13@huawei.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/display/dc/core/dc_stream.c

index 9825c30..72b261a 100644 (file)
@@ -408,7 +408,7 @@ bool dc_stream_set_cursor_position(
        struct dc_stream_state *stream,
        const struct dc_cursor_position *position)
 {
-       struct dc  *dc = stream->ctx->dc;
+       struct dc *dc;
        bool reset_idle_optimizations = false;
 
        if (NULL == stream) {