Commit f04e1831 authored by Alex Hung's avatar Alex Hung Committed by Xia Fukun
Browse files

drm/amd/display: Check denominator pbn_div before used

mainline inclusion
from mainline-v6.11-rc7
commit 116a678f3a9abc24f5c9d2525b7393d18d9eb58e
category: bugfix
bugzilla: https://gitee.com/src-openeuler/kernel/issues/IARWXX
CVE: CVE-2024-46773

Reference: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=116a678f3a9abc24f5c9d2525b7393d18d9eb58e



--------------------------------

[WHAT & HOW]
A denominator cannot be 0, and is checked before used.

This fixes 1 DIVIDE_BY_ZERO issue reported by Coverity.

Reviewed-by: default avatarHarry Wentland <harry.wentland@amd.com>
Signed-off-by: default avatarJerry Zuo <jerry.zuo@amd.com>
Signed-off-by: default avatarAlex Hung <alex.hung@amd.com>
Tested-by: default avatarDaniel Wheeler <daniel.wheeler@amd.com>
Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
Signed-off-by: default avatarXia Fukun <xiafukun@huawei.com>
parent 2d913a6e
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -6934,7 +6934,7 @@ static int dm_update_mst_vcpi_slots_for_dsc(struct drm_atomic_state *state,
			}
		}

		if (j == dc_state->stream_count)
		if (j == dc_state->stream_count || pbn_div == 0)
			continue;

		slot_num = DIV_ROUND_UP(pbn, pbn_div);