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 <[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]>
1 parent 4f32504 commit 13a1851

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

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)