drm/amd/display: Remove redundant assignment to variable dc
Subsystems (3)
PATCH 1/1 drm/amd/display: Remove redundant assignment to variable dc
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.
--- drivers/gpu/drm/amd/display/dc/core/dc_stream.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/amd/display/dc/core/dc_stream.c +1 -1
@@ -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) {
Signature · 1 line
2.17.1
Quoted 10 lines · Yi Yang
Smatch report warning as follows:
Line 53679:
drivers/gpu/drm/amd/display/dc/core/dc_stream.c:402dc_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.
Signed-off-by Yi Yang <[email protected]>
If this didn't blow up until now we might not even need the NULL check below, but either way this is correct and
Harry
Quoted 17 lines
--- drivers/gpu/drm/amd/display/dc/core/dc_stream.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/gpu/drm/amd/display/dc/core/dc_stream.c +1
-1@@ -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) {
Alex Deucher
AppliedApplied. Thanks!
Alex
Quoted 38 lines · Harry Wentland
Quoted 10 lines · Yi Yang
Smatch report warning as follows:
Line 53679:
drivers/gpu/drm/amd/display/dc/core/dc_stream.c:402dc_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.
Signed-off-by Yi Yang <[email protected]>If this didn't blow up until now we might not even need the NULL check below, but either way this is correct and
Reviewed-by Harry Wentland <[email protected]>Harry
Quoted 17 lines
--- drivers/gpu/drm/amd/display/dc/core/dc_stream.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/gpu/drm/amd/display/dc/core/dc_stream.c +1
-1@@ -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) {