[PATCH 07/22] drm/amd/display: Added missing null checks

Tom Chung chiahsuan.chung at amd.com
Wed Mar 20 06:35:41 UTC 2024


From: Sohaib Nadeem <sohaib.nadeem at amd.com>

[why&how]
Add the missing null check before dereference for dc_stream_status*

Fixes: 06653fc22752 ("drm/amd/display: Implement update_planes_and_stream_v3 sequence")
Reviewed-by: Josip Pavic <josip.pavic at amd.com>
Acked-by: Tom Chung <chiahsuan.chung at amd.com>
Signed-off-by: Sohaib Nadeem <sohaib.nadeem at amd.com>
---
 drivers/gpu/drm/amd/display/dc/core/dc.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/gpu/drm/amd/display/dc/core/dc.c b/drivers/gpu/drm/amd/display/dc/core/dc.c
index cc4fd4e0deb6..dd9fe36646a3 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];
 
-- 
2.34.1



More information about the amd-gfx mailing list