diff options
author | Jonathan Gray <jsg@cvs.openbsd.org> | 2024-10-11 02:42:48 +0000 |
---|---|---|
committer | Jonathan Gray <jsg@cvs.openbsd.org> | 2024-10-11 02:42:48 +0000 |
commit | 9817a49b42ae04598feccf42444aad9e32d75144 (patch) | |
tree | acd613002face25e2dd74c1bd03ea18302fe21ae /sys | |
parent | fe67708d166247ed305846eecf4dc1f70bb85f19 (diff) |
drm/amd/pm: ensure the fw_info is not null before using it
From Tim Huang
b511474f49588cdca355ebfce54e7eddbf7b75a5 in linux-6.6.y/6.6.55
186fb12e7a7b038c2710ceb2fb74068f1b5d55a4 in mainline linux
Diffstat (limited to 'sys')
-rw-r--r-- | sys/dev/pci/drm/amd/pm/powerplay/hwmgr/processpptables.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/sys/dev/pci/drm/amd/pm/powerplay/hwmgr/processpptables.c b/sys/dev/pci/drm/amd/pm/powerplay/hwmgr/processpptables.c index 5794b64507b..56a22575258 100644 --- a/sys/dev/pci/drm/amd/pm/powerplay/hwmgr/processpptables.c +++ b/sys/dev/pci/drm/amd/pm/powerplay/hwmgr/processpptables.c @@ -1185,6 +1185,8 @@ static int init_overdrive_limits(struct pp_hwmgr *hwmgr, fw_info = smu_atom_get_data_table(hwmgr->adev, GetIndexIntoMasterTable(DATA, FirmwareInfo), &size, &frev, &crev); + PP_ASSERT_WITH_CODE(fw_info != NULL, + "Missing firmware info!", return -EINVAL); if ((fw_info->ucTableFormatRevision == 1) && (le16_to_cpu(fw_info->usStructureSize) >= sizeof(ATOM_FIRMWARE_INFO_V1_4))) |