Commit 05f5f1d4 authored by winstang's avatar winstang Committed by Heyuan Wang
Browse files

drm/amd/display: added NULL check at start of dc_validate_stream

mainline inclusion
from mainline-v6.11-rc1
commit 26c56049cc4f1705b498df013949427692a4b0d5
category: bugfix
bugzilla: https://gitee.com/src-openeuler/kernel/issues/IAU9N4
CVE: CVE-2024-46802

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



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

[Why]
prevent invalid memory access

[How]
check if dc and stream are NULL

Co-authored-by: default avatarwinstang <winstang@amd.com>
Reviewed-by: default avatarAlvin Lee <alvin.lee2@amd.com>
Acked-by: default avatarZaeem Mohamed <zaeem.mohamed@amd.com>
Signed-off-by: default avatarwinstang <winstang@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 avatarYu Liao <liaoyu15@huawei.com>
parent 8dcdd5a4
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -2914,6 +2914,9 @@ void resource_build_bit_depth_reduction_params(struct dc_stream_state *stream,

enum dc_status dc_validate_stream(struct dc *dc, struct dc_stream_state *stream)
{
	if (dc == NULL || stream == NULL)
		return DC_ERROR_UNEXPECTED;

	struct dc_link *link = stream->link;
	struct timing_generator *tg = dc->res_pool->timing_generators[0];
	enum dc_status res = DC_OK;