From: Srinivasan Shanmugam Date: Wed, 3 Jan 2024 16:52:44 +0000 (+0530) Subject: drm/amdgpu: Fix '*fw' from request_firmware() not released in 'amdgpu_ucode_request()' X-Git-Tag: v6.6.17~240 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=aa1791b280ed36005226e031a622091fa7e5382e;p=platform%2Fkernel%2Flinux-rpi.git drm/amdgpu: Fix '*fw' from request_firmware() not released in 'amdgpu_ucode_request()' [ Upstream commit 13a1851f923d9a7a78a477497295c2dfd16ad4a4 ] Fixes the below: drivers/gpu/drm/amd/amdgpu/amdgpu_ucode.c:1404 amdgpu_ucode_request() warn: '*fw' from request_firmware() not released on lines: 1404. Cc: Mario Limonciello Cc: Lijo Lazar Cc: Christian König Cc: Alex Deucher Signed-off-by: Srinivasan Shanmugam Reviewed-by: Christian König Signed-off-by: Alex Deucher Signed-off-by: Sasha Levin --- diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_ucode.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_ucode.c index 8beefc04..bef7541 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_ucode.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_ucode.c @@ -1326,9 +1326,13 @@ int amdgpu_ucode_request(struct amdgpu_device *adev, const struct firmware **fw, if (err) return -ENODEV; + err = amdgpu_ucode_validate(*fw); - if (err) + if (err) { dev_dbg(adev->dev, "\"%s\" failed to validate\n", fw_name); + release_firmware(*fw); + *fw = NULL; + } return err; }