From 4dbda35ffaa3eb52ecf960b56220644158ddae12 Mon Sep 17 00:00:00 2001 From: Evan Quan Date: Thu, 28 Dec 2017 14:37:58 +0800 Subject: [PATCH] drm/amd/powerplay: set pp_num_states as 0 on error situation Signed-off-by: Evan Quan Acked-by: Alex Deucher Signed-off-by: Alex Deucher --- drivers/gpu/drm/amd/powerplay/amd_powerplay.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/gpu/drm/amd/powerplay/amd_powerplay.c b/drivers/gpu/drm/amd/powerplay/amd_powerplay.c index fa9d1615a2cc..4c3223a4d62b 100644 --- a/drivers/gpu/drm/amd/powerplay/amd_powerplay.c +++ b/drivers/gpu/drm/amd/powerplay/amd_powerplay.c @@ -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) -- 2.30.2