From: Srinivasan Shanmugam Date: Thu, 21 Dec 2023 12:43:11 +0000 (+0530) Subject: drm/amdgpu: Release 'adev->pm.fw' before return in 'amdgpu_device_need_post()' X-Git-Tag: v6.6.17~198 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=25c2de1fbd8ee13008791a3c131f5fed02b3ccec;p=platform%2Fkernel%2Flinux-starfive.git drm/amdgpu: Release 'adev->pm.fw' before return in 'amdgpu_device_need_post()' [ Upstream commit 8a44fdd3cf91debbd09b43bd2519ad2b2486ccf4 ] In function 'amdgpu_device_need_post(struct amdgpu_device *adev)' - 'adev->pm.fw' may not be released before return. Using the function release_firmware() to release adev->pm.fw. Thus fixing the below: drivers/gpu/drm/amd/amdgpu/amdgpu_device.c:1571 amdgpu_device_need_post() warn: 'adev->pm.fw' from request_firmware() not released on lines: 1554. Cc: Monk Liu Cc: Christian König Cc: Alex Deucher Signed-off-by: Srinivasan Shanmugam Suggested-by: Lijo Lazar Reviewed-by: Alex Deucher Signed-off-by: Alex Deucher Signed-off-by: Sasha Levin --- diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c index 56d99ff..7791367 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c @@ -1218,6 +1218,7 @@ bool amdgpu_device_need_post(struct amdgpu_device *adev) return true; fw_ver = *((uint32_t *)adev->pm.fw->data + 69); + release_firmware(adev->pm.fw); if (fw_ver < 0x00160e00) return true; }