Commit c7f01e6e authored by Alex Hung's avatar Alex Hung Committed by Lin Yujun
Browse files

drm/amd/display: Skip wbscl_set_scaler_filter if filter is null

stable inclusion
from stable-v6.6.50
commit e3a95f29647ae45d1ec9541cd7df64f40bf2120a
category: bugfix
bugzilla: https://gitee.com/src-openeuler/kernel/issues/IARVI0
CVE: CVE-2024-46714

Reference: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=e3a95f29647ae45d1ec9541cd7df64f40bf2120a



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

[ Upstream commit c4d31653c03b90e51515b1380115d1aedad925dd ]

Callers can pass null in filter (i.e. from returned from the function
wbscl_get_filter_coeffs_16p) and a null check is added to ensure that is
not the case.

This fixes 4 NULL_RETURNS issues reported by Coverity.

Reviewed-by: default avatarHarry Wentland <harry.wentland@amd.com>
Acked-by: default avatarHamza Mahfooz <hamza.mahfooz@amd.com>
Signed-off-by: default avatarAlex Hung <alex.hung@amd.com>
Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
Signed-off-by: default avatarLin Yujun <linyujun809@huawei.com>
parent 0bd79b86
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -690,6 +690,9 @@ static void wbscl_set_scaler_filter(
	int pair;
	uint16_t odd_coef, even_coef;

	if (!filter)
		return;

	for (phase = 0; phase < (NUM_PHASES / 2 + 1); phase++) {
		for (pair = 0; pair < tap_pairs; pair++) {
			even_coef = filter[phase * taps + 2 * pair];