mirror of
https://github.com/nxp-imx/linux-imx.git
synced 2025-07-06 17:35:20 +02:00
drm/amd/pm: ensure the fw_info is not null before using it
[ Upstream commit 186fb12e7a
]
This resolves the dereference null return value warning
reported by Coverity.
Signed-off-by: Tim Huang <tim.huang@amd.com>
Reviewed-by: Jesse Zhang <jesse.zhang@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
parent
3ffbdc977d
commit
b511474f49
|
@ -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)))
|
||||
|
|
Loading…
Reference in New Issue
Block a user