]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
drm/amd/pp: Fix potential NULL pointer dereference in atomctrl_initialize_mc_reg_table
authorCharles Han <hanchunchao@inspur.com>
Thu, 27 Mar 2025 04:04:35 +0000 (12:04 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 27 Jun 2025 10:05:11 +0000 (11:05 +0100)
commit85cdcb834fb490731ff2d123f87ca799c57dacf2
treeb1d08071f60682770897929c01eef3fdf052c9ea
parent259b74c2b3297ee464cd4a88199dd6aad4d9bb8d
drm/amd/pp: Fix potential NULL pointer dereference in atomctrl_initialize_mc_reg_table

[ Upstream commit 820116a39f96bdc7d426c33a804b52f53700a919 ]

The function atomctrl_initialize_mc_reg_table() and
atomctrl_initialize_mc_reg_table_v2_2() does not check the return
value of smu_atom_get_data_table(). If smu_atom_get_data_table()
fails to retrieve vram_info, it returns NULL which is later
dereferenced.

Fixes: b3892e2bb519 ("drm/amd/pp: Use atombios api directly in powerplay (v2)")
Fixes: 5f92b48cf62c ("drm/amd/pm: add mc register table initialization")
Signed-off-by: Charles Han <hanchunchao@inspur.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/gpu/drm/amd/pm/powerplay/hwmgr/ppatomctrl.c