Skip to content

Commit 13a1851

Browse files
srishanmalexdeucher
authored andcommitted
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 <mario.limonciello@amd.com> Cc: Lijo Lazar <lijo.lazar@amd.com> Cc: Christian König <christian.koenig@amd.com> Cc: Alex Deucher <alexander.deucher@amd.com> Signed-off-by: Srinivasan Shanmugam <srinivasan.shanmugam@amd.com> Reviewed-by: Christian König <christian.koenig@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
1 parent 4f32504 commit 13a1851

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

drivers/gpu/drm/amd/amdgpu/amdgpu_ucode.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1398,9 +1398,13 @@ int amdgpu_ucode_request(struct amdgpu_device *adev, const struct firmware **fw,
13981398

13991399
if (err)
14001400
return -ENODEV;
1401+
14011402
err = amdgpu_ucode_validate(*fw);
1402-
if (err)
1403+
if (err) {
14031404
dev_dbg(adev->dev, "\"%s\" failed to validate\n", fw_name);
1405+
release_firmware(*fw);
1406+
*fw = NULL;
1407+
}
14041408

14051409
return err;
14061410
}

0 commit comments

Comments
 (0)