drm/amd/powerplay: set pp_num_states as 0 on error situation
authorEvan Quan <evan.quan@amd.com>
Thu, 28 Dec 2017 06:37:58 +0000 (14:37 +0800)
committerAlex Deucher <alexander.deucher@amd.com>
Wed, 10 Jan 2018 20:44:52 +0000 (15:44 -0500)
Signed-off-by: Evan Quan <evan.quan@amd.com>
Acked-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/powerplay/amd_powerplay.c

index fa9d1615a2cc5c2aa2cb40c3e28ce57300f54d00..4c3223a4d62b04d0264686e2eb6e493e6daf7c23 100644 (file)
@@ -718,6 +718,8 @@ static int pp_dpm_get_pp_num_states(void *handle,
        struct pp_instance *pp_handle = (struct pp_instance *)handle;
        int ret = 0;
 
+       memset(data, 0, sizeof(*data));
+
        ret = pp_check(pp_handle);
 
        if (ret)