Skip to contentSkip to conversation

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

PATCH New Alex Deucher 1 participant 1 message Jun 1, 2016

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

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

We need to release the firmware on driver tear down.

---
 drivers/gpu/drm/amd/amdgpu/ci_dpm.c      | 3 +++
 drivers/gpu/drm/amd/amdgpu/fiji_dpm.c    | 5 +++++
 drivers/gpu/drm/amd/amdgpu/iceland_dpm.c | 5 +++++
 drivers/gpu/drm/amd/amdgpu/tonga_dpm.c   | 5 +++++
 4 files changed, 18 insertions(+)
drivers/gpu/drm/amd/amdgpu/ci_dpm.c +3 -0
index 671d032..523ddbfc 100644
@@ -6225,6 +6225,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;
 }
 
drivers/gpu/drm/amd/amdgpu/fiji_dpm.c +5 -0
index 245cabf..ed03b75 100644
@@ -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;
 }
 
drivers/gpu/drm/amd/amdgpu/iceland_dpm.c +5 -0
index 460bc8a..825ccd6 100644
@@ -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;
 }
 
drivers/gpu/drm/amd/amdgpu/tonga_dpm.c +5 -0
index b7615ce..f06f6f4 100644
@@ -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;
 }
 
Signature · 6 lines
2.5.5

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel