summaryrefslogtreecommitdiff
path: root/drivers/gpu/drm/amd/display/dc/dml/dcn32
diff options
context:
space:
mode:
authorAlex Hung <alex.hung@amd.com>2024-06-03 14:27:55 -0600
committerAlex Deucher <alexander.deucher@amd.com>2024-06-19 12:44:47 -0400
commit7cf24de30e8ab875abc92a81ff227ab9e5f4282e (patch)
tree96efc22fe3b735ceaa0e09be729517b3a1464357 /drivers/gpu/drm/amd/display/dc/dml/dcn32
parent470f3760cfe6dd2ce66cf9159e65876f7eb28792 (diff)
downloadlwn-7cf24de30e8ab875abc92a81ff227ab9e5f4282e.tar.gz
lwn-7cf24de30e8ab875abc92a81ff227ab9e5f4282e.zip
drm/amd/display: Check pipe_ctx before it is used
resource_get_odm_slice_count and resource_get_otg_master_for_stream can return null, and their returns must be checked before used. This fixes 4 NULL_RETURNS issues reported by Coverity. Reviewed-by: Harry Wentland <harry.wentland@amd.com> Acked-by: Hamza Mahfooz <hamza.mahfooz@amd.com> Signed-off-by: Alex Hung <alex.hung@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'drivers/gpu/drm/amd/display/dc/dml/dcn32')
-rw-r--r--drivers/gpu/drm/amd/display/dc/dml/dcn32/dcn32_fpu.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/gpu/drm/amd/display/dc/dml/dcn32/dcn32_fpu.c b/drivers/gpu/drm/amd/display/dc/dml/dcn32/dcn32_fpu.c
index a63b5dcba3f5..7abf8b88ca91 100644
--- a/drivers/gpu/drm/amd/display/dc/dml/dcn32/dcn32_fpu.c
+++ b/drivers/gpu/drm/amd/display/dc/dml/dcn32/dcn32_fpu.c
@@ -1177,6 +1177,9 @@ static void init_pipe_slice_table_from_context(
stream = context->streams[i];
otg_master = resource_get_otg_master_for_stream(
&context->res_ctx, stream);
+ if (!otg_master)
+ continue;
+
count = resource_get_odm_slice_count(otg_master);
update_slice_table_for_stream(table, stream, count);