Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 768c95e7 authored by Alex Deucher's avatar Alex Deucher
Browse files

drm/amdgpu: fix fw leak in non-powerplay dpm code



We need to release the firmware on driver tear down.

Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
parent a6dcfd9c
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -6221,6 +6221,9 @@ static int ci_dpm_sw_fini(void *handle)
	ci_dpm_fini(adev);
	mutex_unlock(&adev->pm.mutex);

	release_firmware(adev->pm.fw);
	adev->pm.fw = NULL;

	return 0;
}

+5 −0
Original line number Diff line number Diff line
@@ -72,6 +72,11 @@ static int fiji_dpm_sw_init(void *handle)

static int fiji_dpm_sw_fini(void *handle)
{
	struct amdgpu_device *adev = (struct amdgpu_device *)handle;

	release_firmware(adev->pm.fw);
	adev->pm.fw = NULL;

	return 0;
}

+5 −0
Original line number Diff line number Diff line
@@ -72,6 +72,11 @@ static int iceland_dpm_sw_init(void *handle)

static int iceland_dpm_sw_fini(void *handle)
{
	struct amdgpu_device *adev = (struct amdgpu_device *)handle;

	release_firmware(adev->pm.fw);
	adev->pm.fw = NULL;

	return 0;
}

+5 −0
Original line number Diff line number Diff line
@@ -71,6 +71,11 @@ static int tonga_dpm_sw_init(void *handle)

static int tonga_dpm_sw_fini(void *handle)
{
	struct amdgpu_device *adev = (struct amdgpu_device *)handle;

	release_firmware(adev->pm.fw);
	adev->pm.fw = NULL;

	return 0;
}