[PATCH] drm/amd/powerplay: fix a warning in pp_hw_init

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Make sure hwmgr is valid.

Signed-off-by: Alex Deucher <alexander.deucher at amd.com>
---
 drivers/gpu/drm/amd/powerplay/amd_powerplay.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/amd/powerplay/amd_powerplay.c b/drivers/gpu/drm/amd/powerplay/amd_powerplay.c
index 44b0616..e96ab0b 100644
--- a/drivers/gpu/drm/amd/powerplay/amd_powerplay.c
+++ b/drivers/gpu/drm/amd/powerplay/amd_powerplay.c
@@ -146,7 +146,7 @@ static int pp_hw_init(void *handle)
 {
 	int ret = 0;
 	struct pp_instance *pp_handle = (struct pp_instance *)handle;
-	struct pp_hwmgr *hwmgr;
+	struct pp_hwmgr *hwmgr = NULL;
 
 	ret = pp_check(pp_handle);
 
@@ -171,7 +171,8 @@ static int pp_hw_init(void *handle)
 	return 0;
 exit:
 	pp_handle->pm_en = 0;
-	cgs_notify_dpm_enabled(hwmgr->device, false);
+	if (hwmgr)
+		cgs_notify_dpm_enabled(hwmgr->device, false);
 	return 0;
 
 }
-- 
2.5.5



[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux