]> www.infradead.org Git - users/jedix/linux-maple.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)
committerAlex Deucher <alexander.deucher@amd.com>
Mon, 7 Apr 2025 19:18:58 +0000 (15:18 -0400)
commit820116a39f96bdc7d426c33a804b52f53700a919
treec04e8c052f5c4de17a3566364208a27df6436468
parentd69248cf4c91949a7b83b3fd77c7c229336bb23c
drm/amd/pp: Fix potential NULL pointer dereference in atomctrl_initialize_mc_reg_table

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>
drivers/gpu/drm/amd/pm/powerplay/hwmgr/ppatomctrl.c