Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

drm/amdgpu: Fix potential NULL pointer dereference in atomctrl_get_smc_sclk_range_table

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>

authored by

Ivan Stepchenko and committed by
Alex Deucher
357445e2 de258d06

+2
+2
drivers/gpu/drm/amd/pm/powerplay/hwmgr/ppatomctrl.c
··· 992 992 GetIndexIntoMasterTable(DATA, SMU_Info), 993 993 &size, &frev, &crev); 994 994 995 + if (!psmu_info) 996 + return -EINVAL; 995 997 996 998 for (i = 0; i < psmu_info->ucSclkEntryNum; i++) { 997 999 table->entry[i].ucVco_setting = psmu_info->asSclkFcwRangeEntry[i].ucVco_setting;