Hi Alex,

Thanks for pointing out the logic error in pp_hw_init.
Please review the attached patch.

Best Regards
Rex



-----Original Message-----
From: amd-gfx [mailto:[email protected]] On Behalf Of Alex 
Deucher
Sent: Saturday, September 30, 2017 12:38 AM
To: [email protected]
Cc: Deucher, Alexander
Subject: [PATCH] drm/amd/powerplay: fix a warning in pp_hw_init

Make sure hwmgr is valid.

Signed-off-by: Alex Deucher <[email protected]>
---
 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

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

Attachment: 0001-drm-amd-powerplay-fix-a-logic-error-in-pp_hw_init.patch
Description: 0001-drm-amd-powerplay-fix-a-logic-error-in-pp_hw_init.patch

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

Reply via email to