summaryrefslogtreecommitdiff
path: root/drivers/gpu/drm/amd/display/dc/core/dc.c
diff options
context:
space:
mode:
authorSohaib Nadeem <sohaib.nadeem@amd.com>2024-03-12 17:32:28 -0400
committerAlex Deucher <alexander.deucher@amd.com>2024-03-27 01:36:44 -0400
commite4067957363742c762eb68041367e5ea9a465f60 (patch)
tree7d96b0d275a7475ee7d66aca2e80d21506236ecb /drivers/gpu/drm/amd/display/dc/core/dc.c
parent9d43241953f729626a7d452417a2832092a9ec1d (diff)
drm/amd/display: Added missing null checks
[why&how] Add the missing null check before dereference for dc_stream_status* Fixes: 2d5bb791e24f ("drm/amd/display: Implement update_planes_and_stream_v3 sequence") Reviewed-by: Josip Pavic <josip.pavic@amd.com> Acked-by: Tom Chung <chiahsuan.chung@amd.com> Signed-off-by: Sohaib Nadeem <sohaib.nadeem@amd.com> Tested-by: Daniel Wheeler <daniel.wheeler@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'drivers/gpu/drm/amd/display/dc/core/dc.c')
-rw-r--r--drivers/gpu/drm/amd/display/dc/core/dc.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/gpu/drm/amd/display/dc/core/dc.c b/drivers/gpu/drm/amd/display/dc/core/dc.c
index 7222917e48bb..9030251388db 100644
--- a/drivers/gpu/drm/amd/display/dc/core/dc.c
+++ b/drivers/gpu/drm/amd/display/dc/core/dc.c
@@ -4291,6 +4291,9 @@ static int initialize_empty_surface_updates(
struct dc_stream_status *status = dc_stream_get_status(stream);
int i;
+ if (!status)
+ return 0;
+
for (i = 0; i < status->plane_count; i++)
srf_updates[i].surface = status->plane_states[i];