drm/amd/display: Remove unnecessary NULL check in commit_planes_for_stream()
authorDan Carpenter <dan.carpenter@oracle.com>
Wed, 13 Jul 2022 11:33:37 +0000 (14:33 +0300)
committerAlex Deucher <alexander.deucher@amd.com>
Mon, 18 Jul 2022 20:42:39 +0000 (16:42 -0400)
Smatch complains that:

    drivers/gpu/drm/amd/amdgpu/../display/dc/core/dc.c:3369 commit_planes_for_stream()
    warn: variable dereferenced before check 'stream' (see line 3114)

The 'stream' pointer cannot be NULL and the check can be removed.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/display/dc/core/dc.c

index 51c9563ad13716fb0745834c86076d1244aa82b2..e42f44fc1c08d50bffe551703c1a75df2d62d958 100644 (file)
@@ -3478,7 +3478,7 @@ static void commit_planes_for_stream(struct dc *dc,
                                top_pipe_to_program->stream_res.tg,
                                CRTC_STATE_VACTIVE);
 
-                       if (stream && should_use_dmub_lock(stream->link)) {
+                       if (should_use_dmub_lock(stream->link)) {
                                union dmub_hw_lock_flags hw_locks = { 0 };
                                struct dmub_hw_lock_inst_flags inst_flags = { 0 };