aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/amd/amdgpu/amdgpu_ucode.c
diff options
context:
space:
mode:
authorSrinivasan Shanmugam <[email protected]>2024-01-03 16:52:44 +0000
committerAlex Deucher <[email protected]>2024-01-05 21:10:43 +0000
commit13a1851f923d9a7a78a477497295c2dfd16ad4a4 (patch)
treed7f7312cf00e3735a8edee2bd3971ee92f24248d /drivers/gpu/drm/amd/amdgpu/amdgpu_ucode.c
parentdrm/amdgpu: Fix variable 'mca_funcs' dereferenced before NULL check in 'amdgp... (diff)
downloadkernel-13a1851f923d9a7a78a477497295c2dfd16ad4a4.tar.gz
kernel-13a1851f923d9a7a78a477497295c2dfd16ad4a4.zip
drm/amdgpu: Fix '*fw' from request_firmware() not released in 'amdgpu_ucode_request()'
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 <[email protected]> Cc: Lijo Lazar <[email protected]> Cc: Christian König <[email protected]> Cc: Alex Deucher <[email protected]> Signed-off-by: Srinivasan Shanmugam <[email protected]> Reviewed-by: Christian König <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
Diffstat (limited to 'drivers/gpu/drm/amd/amdgpu/amdgpu_ucode.c')
-rw-r--r--drivers/gpu/drm/amd/amdgpu/amdgpu_ucode.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_ucode.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_ucode.c
index 1f67914568f6..d334e42fe0eb 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_ucode.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_ucode.c
@@ -1398,9 +1398,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;
}