mirror_ubuntu-kernels/drivers/gpu/drm/amd/display/dc
Alex Hung 01eb50e53c drm/amd/display: ASSERT when failing to find index by plane/stream id
[WHY]
find_disp_cfg_idx_by_plane_id and find_disp_cfg_idx_by_stream_id returns
an array index and they return -1 when not found; however, -1 is not a
valid index number.

[HOW]
When this happens, call ASSERT(), and return a positive number (which is
fewer than callers' array size) instead.

This fixes 4 OVERRUN and 2 NEGATIVE_RETURNS issues reported by Coverity.

Reviewed-by: Rodrigo Siqueira <rodrigo.siqueira@amd.com>
Acked-by: Wayne Lin <wayne.lin@amd.com>
Signed-off-by: Alex Hung <alex.hung@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2024-04-26 17:22:44 -04:00
..
basics drm/amd/display: Drop unnecessary header 2024-02-22 10:26:08 -05:00
bios drm/amd/display: Add driver support for future FAMS versions 2024-04-09 22:15:26 -04:00
clk_mgr drm/amd/display: Add NULL pointer check for kzalloc 2024-04-26 17:22:43 -04:00
core drm/amd/display: Do not return negative stream id for array 2024-04-26 17:22:44 -04:00
dce drm/amd/display: Remove unnecessary code 2024-04-16 21:51:54 -04:00
dce60 kbuild: make -Woverride-init warnings more consistent 2024-03-31 11:32:26 +09:00
dce80 kbuild: make -Woverride-init warnings more consistent 2024-03-31 11:32:26 +09:00
dce110 kbuild: make -Woverride-init warnings more consistent 2024-03-31 11:32:26 +09:00
dce112 kbuild: make -Woverride-init warnings more consistent 2024-03-31 11:32:26 +09:00
dce120 kbuild: make -Woverride-init warnings more consistent 2024-03-31 11:32:26 +09:00
dcn10 drm/amd/display: Rework dcn10_stream_encoder header 2024-04-16 22:39:15 -04:00
dcn20 drm/amd/display: Add missing debug registers for DCN2/3/3.1 2024-04-26 17:22:40 -04:00
dcn21 drm/amd/display: Modify DHCUB waterwark structures and functions 2024-03-27 01:43:28 -04:00
dcn30 drm/amd/display: Add some missing HDMI registers for DCN3x 2024-04-26 17:22:42 -04:00
dcn31 drm/amd/display: Handle Y carry-over in VCP X.Y calculation 2024-04-26 17:22:43 -04:00
dcn32 Revert "drm/amd/display: fix USB-C flag update after enc10 feature init" 2024-04-16 21:25:44 -04:00
dcn35 Revert "drm/amd/display: fix USB-C flag update after enc10 feature init" 2024-04-16 21:25:44 -04:00
dcn201 drm/amd/display: Update DCN201 link encoder registers 2024-04-16 22:39:15 -04:00
dcn301 drm/amd/display: Remove duplicated function signature from dcn3.01 DCCG 2024-04-26 17:22:40 -04:00
dcn302 drm/amd/display: Refactor INIT into component folder 2024-01-03 10:47:29 -05:00
dcn303 drm/amd/display: Refactor INIT into component folder 2024-01-03 10:47:29 -05:00
dcn314 drm/amd/display: Refactor INIT into component folder 2024-01-03 10:47:29 -05:00
dcn321 drm/amd/display: Refactor resource into component directory 2023-11-17 09:30:50 -05:00
dml drm/amd/display: delete the redundant initialization in dcn3_51_soc 2024-04-09 22:19:52 -04:00
dml2 drm/amd/display: ASSERT when failing to find index by plane/stream id 2024-04-26 17:22:44 -04:00
dpp Revert "drm/amd/display: Enable cur_rom_en even if cursor degamma is not enabled" 2024-04-16 22:39:15 -04:00
dsc drm/amd/display: Fix division by zero in setup_dsc_config 2024-04-26 17:22:40 -04:00
gpio drm/amd/display: Drop legacy code 2024-04-09 22:06:09 -04:00
hdcp drm/amd/display: Drop unnecessary header 2024-02-22 10:26:08 -05:00
hwss drm/amd/display: Remove unnecessary NULL check in dcn20_set_input_transfer_func 2024-04-26 17:22:41 -04:00
inc drm/amd/display: Reorganize dwb header 2024-04-12 00:36:27 -04:00
irq drm/amd/display: Check pipe offset before setting vblank 2024-04-26 17:22:44 -04:00
link drm/amd/display: Change DPCD address range 2024-04-12 00:35:41 -04:00
optc Revert "drm/amd/display: Add fallback configuration when set DRR" 2024-04-26 17:22:38 -04:00
resource drm/amd/display: Add NULL pointer check for kzalloc 2024-04-26 17:22:43 -04:00
virtual
dc_bios_types.h drm/amd/display: Pass pwrseq inst for backlight and ABM 2023-12-06 15:22:33 -05:00
dc_ddc_types.h
dc_dmub_srv.c drm/amd/display: Add driver support for future FAMS versions 2024-04-09 22:15:26 -04:00
dc_dmub_srv.h drm/amd/display: Add driver support for future FAMS versions 2024-04-09 22:15:26 -04:00
dc_dp_types.h drm/amd/display: expand the non standard link rate for testing 2024-04-09 22:15:52 -04:00
dc_dsc.h drm/amd/display: Add link encoding to timing BW calculation parameters 2023-07-18 11:15:51 -04:00
dc_edid_parser.c
dc_edid_parser.h
dc_hdmi_types.h drm/amd/display/dc/dc_hdmi_types: Move string definition to the only file it's used in 2023-03-22 00:47:59 -04:00
dc_helper.c drm/amd/display: Wake DMCUB before sending a command 2023-12-19 14:59:02 -05:00
dc_hw_types.h drm/amd/display: add support for chroma offset 2024-04-16 21:24:08 -04:00
dc_plane_priv.h drm/amd/display: Add driver support for future FAMS versions 2024-04-09 22:15:26 -04:00
dc_plane.h drm/amd/display: Refactor DML2 interfaces 2024-03-27 01:36:37 -04:00
dc_stat.h
dc_state_priv.h drm/amd/display: Refactor DML2 interfaces 2024-03-27 01:36:37 -04:00
dc_state.h drm/amd/display: Add handling for DC power mode 2024-04-09 22:04:51 -04:00
dc_stream_priv.h drm/amd/display: Refactor phantom resource allocation 2023-12-19 14:59:02 -05:00
dc_stream.h drm/amd/display: Add handling for DC power mode 2024-04-09 22:04:51 -04:00
dc_trace.h
dc_types.h drm/amd/display: Add missing replay field 2024-04-16 22:39:15 -04:00
dc.h drm/amd/display: 3.2.281 2024-04-16 22:39:15 -04:00
dm_cp_psp.h drm/amd/display: Trivial code style adjustment 2024-02-07 12:26:23 -05:00
dm_event_log.h
dm_helpers.h drm/amd/display: adjust flow for deallocation mst payload 2023-11-29 16:49:00 -05:00
dm_pp_smu.h drm/amd/pm: support return vpe clock table 2023-12-14 15:25:59 -05:00
dm_services_types.h drm/amd/display: refactor dmub commands into single function 2023-04-18 16:28:52 -04:00
dm_services.h drm/amd/display: Add dummy interface for tracing DCN32 SMU messages 2024-04-09 22:03:13 -04:00
irq_types.h drm/amd/display: Correct enum typo 2023-10-26 18:59:56 -04:00
Makefile drm/amd/display: Refactor DPP into a component directory 2024-03-20 13:37:37 -04:00
os_types.h drm/amd/display: switch DC over to the new DRM logging macros 2023-09-26 17:00:21 -04:00