[PATCH] drm/amdgpu: Fix 'adev->gfx.rlc_fw' from request_firmware() not released in 'gfx_v10_0_init_microcode()'
Liu, Monk
Monk.Liu at amd.com
Tue Jan 23 08:23:14 UTC 2024
[AMD Official Use Only - General]
+ @Yin, ZhenGuo (Chris)<mailto:ZhenGuo.Yin at amd.com> for review
BR/
Monk Liu (Cloud and Virtualization Solution, SRDC)
From: amd-gfx <amd-gfx-bounces at lists.freedesktop.org> on behalf of Srinivasan Shanmugam <srinivasan.shanmugam at amd.com>
Date: Tuesday, January 23, 2024 at 16:09
To: Koenig, Christian <Christian.Koenig at amd.com>, Deucher, Alexander <Alexander.Deucher at amd.com>
Cc: Lazar, Lijo <Lijo.Lazar at amd.com>, SHANMUGAM, SRINIVASAN <SRINIVASAN.SHANMUGAM at amd.com>, Liu, Monk <Monk.Liu at amd.com>, amd-gfx at lists.freedesktop.org <amd-gfx at lists.freedesktop.org>, Zhang, Hawking <Hawking.Zhang at amd.com>
Subject: [PATCH] drm/amdgpu: Fix 'adev->gfx.rlc_fw' from request_firmware() not released in 'gfx_v10_0_init_microcode()'
'adev->gfx.rlc_fw' may not be released before end of
gfx_v10_0_init_microcode() function.
Using the function release_firmware() to release adev->gfx.rlc_fw.
Fixes the below:
drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c:4046 gfx_v10_0_init_microcode() warn: 'adev->gfx.rlc_fw' from request_firmware() not released on lines: 4046.
Fixes: 1797ec7ffd1b ("drm/amdgpu: skip rlc ucode loading for SRIOV gfx10")
Cc: Monk Liu <Monk.Liu at amd.com>
Cc: Lijo Lazar <lijo.lazar at amd.com>
Cc: Hawking Zhang <Hawking.Zhang at amd.com>
Cc: Christian König <christian.koenig at amd.com>
Cc: Alex Deucher <alexander.deucher at amd.com>
Signed-off-by: Srinivasan Shanmugam <srinivasan.shanmugam at amd.com>
---
drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c b/drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c
index 420c82b54650..ce76fbcc2602 100644
--- a/drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c
+++ b/drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c
@@ -4006,6 +4006,7 @@ static int gfx_v10_0_init_microcode(struct amdgpu_device *adev)
rlc_hdr = (const struct rlc_firmware_header_v2_0 *)adev->gfx.rlc_fw->data;
version_major = le16_to_cpu(rlc_hdr->header.header_version_major);
version_minor = le16_to_cpu(rlc_hdr->header.header_version_minor);
+ release_firmware(adev->gfx.rlc_fw);
err = amdgpu_gfx_rlc_init_microcode(adev, version_major, version_minor);
if (err)
goto out;
--
2.34.1
-------------- next part --------------
A non-text attachment was scrubbed...
Name: winmail.dat
Type: application/ms-tnef
Size: 22720 bytes
Desc: not available
URL: <https://lists.freedesktop.org/archives/amd-gfx/attachments/20240123/23eb0502/attachment-0001.bin>
More information about the amd-gfx
mailing list