From 9817a49b42ae04598feccf42444aad9e32d75144 Mon Sep 17 00:00:00 2001 From: Jonathan Gray Date: Fri, 11 Oct 2024 02:42:48 +0000 Subject: 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 --- sys/dev/pci/drm/amd/pm/powerplay/hwmgr/processpptables.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'sys/dev/pci/drm') 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))) -- cgit v1.2.3