Commit 8b0c3a82 authored by Alex Hung's avatar Alex Hung Committed by Xiaomeng Zhang
Browse files

drm/amd/display: Check null pointer before dereferencing se

stable inclusion
from stable-v5.10.227
commit f4149eec960110ffd5bcb161075dd9f1d7773075
category: bugfix
bugzilla: https://gitee.com/src-openeuler/kernel/issues/IAZM9Wi
CVE: CVE-2024-50049

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



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

[ Upstream commit ff599ef6970ee000fa5bc38d02fa5ff5f3fc7575 ]

[WHAT & HOW]
se is null checked previously in the same function, indicating
it might be null; therefore, it must be checked when used again.

This fixes 1 FORWARD_NULL issue reported by Coverity.

Acked-by: default avatarAlex Hung <alex.hung@amd.com>
Reviewed-by: default avatarRodrigo Siqueira <rodrigo.siqueira@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 avatarSasha Levin <sashal@kernel.org>
Signed-off-by: default avatarXiaomeng Zhang <zhangxiaomeng13@huawei.com>
parent 5e37324a
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -1252,7 +1252,7 @@ bool dc_validate_seamless_boot_timing(const struct dc *dc,
		if (crtc_timing->pix_clk_100hz != pix_clk_100hz)
			return false;

		if (!se->funcs->dp_get_pixel_format)
		if (!se || !se->funcs->dp_get_pixel_format)
			return false;

		if (!se->funcs->dp_get_pixel_format(