Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

drm/amdgpu: Avoid to release the FW twice in the validated error

There will to release the FW twice when the FW validated error.
Even if the release_firmware() will further validate the FW whether
is empty, but that will be redundant and inefficient.

Signed-off-by: Prike Liang <Prike.Liang@amd.com>
Reviewed-by: Lijo Lazar <lijo.lazar@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>

authored by

Prike Liang and committed by
Alex Deucher
d2382f29 a567db80

+6 -4
+6 -4
drivers/gpu/drm/amd/amdgpu/amdgpu_ucode.c
··· 1461 1461 return -ENODEV; 1462 1462 1463 1463 r = amdgpu_ucode_validate(*fw); 1464 - if (r) { 1464 + if (r) 1465 + /* 1466 + * The amdgpu_ucode_request() should be paired with amdgpu_ucode_release() 1467 + * regardless of success/failure, and the amdgpu_ucode_release() takes care of 1468 + * firmware release and need to avoid redundant release FW operation here. 1469 + */ 1465 1470 dev_dbg(adev->dev, "\"%s\" failed to validate\n", fname); 1466 - release_firmware(*fw); 1467 - *fw = NULL; 1468 - } 1469 1471 1470 1472 return r; 1471 1473 }