]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
drm/amdgpu: Fix potential NULL pointer dereference in atomctrl_get_smc_sclk_range_table
authorIvan Stepchenko <sid@itb.spb.ru>
Mon, 2 Dec 2024 08:00:43 +0000 (11:00 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 13 Mar 2025 11:49:52 +0000 (12:49 +0100)
commit2396bc91935c6da0588ce07850d07897974bd350
treeba9b3e7a9c8d4ee2fa0702b878b2bca6fc027348
parenta32ea3f982b389ea43a41ce77b6fb70d74006d9b
drm/amdgpu: Fix potential NULL pointer dereference in atomctrl_get_smc_sclk_range_table

[ Upstream commit 357445e28ff004d7f10967aa93ddb4bffa5c3688 ]

The function atomctrl_get_smc_sclk_range_table() does not check the return
value of smu_atom_get_data_table(). If smu_atom_get_data_table() fails to
retrieve SMU_Info table, it returns NULL which is later dereferenced.

Found by Linux Verification Center (linuxtesting.org) with SVACE.

In practice this should never happen as this code only gets called
on polaris chips and the vbios data table will always be present on
those chips.

Fixes: a23eefa2f461 ("drm/amd/powerplay: enable dpm for baffin.")
Signed-off-by: Ivan Stepchenko <sid@itb.spb.ru>
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