]> git.baikalelectronics.ru Git - kernel.git/commitdiff
drm/amd/display: do not dereference on NULL
authorNirmoy Das <nirmoy.das@amd.com>
Thu, 27 May 2021 12:03:33 +0000 (14:03 +0200)
committerAlex Deucher <alexander.deucher@amd.com>
Wed, 2 Jun 2021 02:36:57 +0000 (22:36 -0400)
WARN_ON() will not kill the process so the second WARN_ON()
will try to dereference NULL pointer.

Signed-off-by: Nirmoy Das <nirmoy.das@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c

index f14700a0515adead657b344f1471b96ff7b7bd26..4fd6f4a7d3921f0f4898e6199bfff30a434737c0 100644 (file)
@@ -9013,7 +9013,10 @@ static void amdgpu_dm_atomic_commit_tail(struct drm_atomic_state *state)
                }
 
                status = dc_stream_get_status(dm_new_crtc_state->stream);
-               WARN_ON(!status);
+
+               if (WARN_ON(!status))
+                       continue;
+
                WARN_ON(!status->plane_count);
 
                /*