]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
drm/amd/display: Initialize get_bytes_per_element's default to 1
authorAlex Hung <alex.hung@amd.com>
Mon, 15 Jul 2024 15:57:01 +0000 (09:57 -0600)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 17 Oct 2024 13:11:31 +0000 (15:11 +0200)
commit1f9f8186e239222f1c8d3dd73bf3bc6ae86c5e76
tree07b49c364084f97915e50d92664aa5b56151662e
parentc13f9c62015c56a938304cef6d507227ea3e0039
drm/amd/display: Initialize get_bytes_per_element's default to 1

[ Upstream commit 4067f4fa0423a89fb19a30b57231b384d77d2610 ]

Variables, used as denominators and maybe not assigned to other values,
should not be 0. bytes_per_element_y & bytes_per_element_c are
initialized by get_bytes_per_element() which should never return 0.

This fixes 10 DIVIDE_BY_ZERO issues reported by Coverity.

Signed-off-by: Alex Hung <alex.hung@amd.com>
Reviewed-by: Aurabindo Pillai <aurabindo.pillai@amd.com>
Tested-by: Daniel Wheeler <daniel.wheeler@amd.com>
Signed-off-by: Rodrigo Siqueira <rodrigo.siqueira@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/gpu/drm/amd/display/dc/dml/dcn20/display_rq_dlg_calc_20v2.c
drivers/gpu/drm/amd/display/dc/dml/dcn21/display_rq_dlg_calc_21.c