Loading
drm/amd/display: Add NULL check for clk_mgr in dcn32_init_hw
stable inclusion from stable-v6.10.14 commit f0454b3cb0584a6bf275aeb49be61a760fd546a2 category: bugfix bugzilla: https://gitee.com/src-openeuler/kernel/issues/IAYR9K CVE: CVE-2024-49915 Reference: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=f0454b3cb0584a6bf275aeb49be61a760fd546a2 -------------------------------- [ Upstream commit c395fd47d1565bd67671f45cca281b3acc2c31ef ] This commit addresses a potential null pointer dereference issue in the `dcn32_init_hw` function. The issue could occur when `dc->clk_mgr` is null. The fix adds a check to ensure `dc->clk_mgr` is not null before accessing its functions. This prevents a potential null pointer dereference. Reported by smatch: drivers/gpu/drm/amd/amdgpu/../display/dc/hwss/dcn32/dcn32_hwseq.c:961 dcn32_init_hw() error: we previously assumed 'dc->clk_mgr' could be null (see line 782) Cc: Tom Chung <chiahsuan.chung@amd.com> Cc: Rodrigo Siqueira <Rodrigo.Siqueira@amd.com> Cc: Roman Li <roman.li@amd.com> Cc: Alex Hung <alex.hung@amd.com> Cc: Aurabindo Pillai <aurabindo.pillai@amd.com> Cc: Harry Wentland <harry.wentland@amd.com> Cc: Hamza Mahfooz <hamza.mahfooz@amd.com> Signed-off-by:Srinivasan Shanmugam <srinivasan.shanmugam@amd.com> Reviewed-by:
Alex Hung <alex.hung@amd.com> Signed-off-by:
Alex Deucher <alexander.deucher@amd.com> Signed-off-by:
Sasha Levin <sashal@kernel.org> Conflicts: drivers/gpu/drm/amd/display/dc/dcn32/dcn32_hwseq.c [Context conflicts, the file of drivers/gpu/drm/amd/display/dc/dcn32/dcn32_hwseq.c has been moved to file drivers/gpu/drm/amd/display/dc/hwss/dcn32/dcn32_hwseq.c int v6.10.14] Signed-off-by:
dinglongwei <dinglongwei1@huawei.com>