]> www.infradead.org Git - users/jedix/linux-maple.git/commit
drm/amd/display: Add null checks before accessing struct elements
authorAlex Hung <alex.hung@amd.com>
Thu, 6 Jun 2024 21:42:36 +0000 (15:42 -0600)
committerAlex Deucher <alexander.deucher@amd.com>
Thu, 27 Jun 2024 21:10:37 +0000 (17:10 -0400)
commite1f4805bcc6b39e1c249777c237e419705266234
treea82c30948860e18dfc328abb123693a954814946
parent0dd1190faff7f7b389291266e118deb381b6c8d9
drm/amd/display: Add null checks before accessing struct elements

[WHAT]
1. is_pwrseq0 needs to check link before accessing link->link_index.
2. context is checked before accessing its bw_ctx.dml2
3. clk_mgr_base->bw_params is checked before clk_table.num_entries_per_cl

This fixes 4 REVERSE_INULL issues reported by Coverity.

Reviewed-by: Rodrigo Siqueira <rodrigo.siqueira@amd.com>
Signed-off-by: Alex Hung <alex.hung@amd.com>
Tested-by: Daniel Wheeler <daniel.wheeler@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/display/dc/clk_mgr/dcn32/dcn32_clk_mgr.c
drivers/gpu/drm/amd/display/dc/clk_mgr/dcn401/dcn401_clk_mgr.c
drivers/gpu/drm/amd/display/dc/dml/dcn20/dcn20_fpu.c
drivers/gpu/drm/amd/display/dc/dml2/dml2_wrapper.c