[PATCH 2/7] drm/amd/amdgpu: Allow calling si_dpm_fini at any point

Tom St Denis tstdenis82 at gmail.com
Tue Sep 6 16:18:39 UTC 2016


Allow calling fini even if ps array is not allocated.

Signed-off-by: Tom St Denis <tom.stdenis at amd.com>
---
 drivers/gpu/drm/amd/amdgpu/si_dpm.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/gpu/drm/amd/amdgpu/si_dpm.c b/drivers/gpu/drm/amd/amdgpu/si_dpm.c
index e90bb4423cc7..2a72b2b5801d 100644
--- a/drivers/gpu/drm/amd/amdgpu/si_dpm.c
+++ b/drivers/gpu/drm/amd/amdgpu/si_dpm.c
@@ -7519,9 +7519,9 @@ static void si_dpm_fini(struct amdgpu_device *adev)
 {
 	int i;
 
-	for (i = 0; i < adev->pm.dpm.num_ps; i++) {
-		kfree(adev->pm.dpm.ps[i].ps_priv);
-	}
+	if (adev->pm.dpm.ps)
+		for (i = 0; i < adev->pm.dpm.num_ps; i++)
+			kfree(adev->pm.dpm.ps[i].ps_priv);
 	kfree(adev->pm.dpm.ps);
 	kfree(adev->pm.dpm.priv);
 	kfree(adev->pm.dpm.dyn_state.vddc_dependency_on_dispclk.entries);
-- 
2.9.3



More information about the amd-gfx mailing list