提交 0b45541d 编写于 作者: M Mykola Lysenko 提交者: Alex Deucher

drm/amdgpu: fix memory leak in CGS (FW info)

Previously requested FW pointer should not be
overwritten on a subsequent call.
Reviewed-by: NAlex Deucher <alexander.deucher@amd.com>
Signed-off-by: NMykola Lysenko <Mykola.Lysenko@amd.com>
Signed-off-by: NAlex Deucher <alexander.deucher@amd.com>
上级 b0d11345
......@@ -735,6 +735,7 @@ static int amdgpu_cgs_get_firmware_info(struct cgs_device *cgs_device,
const uint8_t *src;
const struct smc_firmware_header_v1_0 *hdr;
if (!adev->pm.fw) {
switch (adev->asic_type) {
case CHIP_TONGA:
strcpy(fw_name, "amdgpu/tonga_smc.bin");
......@@ -772,6 +773,7 @@ static int amdgpu_cgs_get_firmware_info(struct cgs_device *cgs_device,
adev->pm.fw = NULL;
return err;
}
}
hdr = (const struct smc_firmware_header_v1_0 *) adev->pm.fw->data;
adev->pm.fw_version = le32_to_cpu(hdr->header.ucode_version);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册