summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjsg <jsg@openbsd.org>2020-06-22 09:54:02 +0000
committerjsg <jsg@openbsd.org>2020-06-22 09:54:02 +0000
commit0aa4dccb26b295ba3b1960b6e0f300a2bf4cf0af (patch)
treef8498a1dc52d4cb53e578016774b30f93b0886a0
parentdrm/amd/display: fix virtual signal dsc setup (diff)
downloadwireguard-openbsd-0aa4dccb26b295ba3b1960b6e0f300a2bf4cf0af.tar.xz
wireguard-openbsd-0aa4dccb26b295ba3b1960b6e0f300a2bf4cf0af.zip
drm/amdgpu: Init data to avoid oops while reading pp_num_states.
From limingyu 4ceae1cf8ca686b64a68822677ef0fb69a917c4e in linux 5.7.y/5.7.5 6f81b2d047c59eb77cd04795a44245d6a52cdaec in mainline linux
-rw-r--r--sys/dev/pci/drm/amd/amdgpu/amdgpu_pm.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/sys/dev/pci/drm/amd/amdgpu/amdgpu_pm.c b/sys/dev/pci/drm/amd/amdgpu/amdgpu_pm.c
index 08022c0e35b..7201e6dfae7 100644
--- a/sys/dev/pci/drm/amd/amdgpu/amdgpu_pm.c
+++ b/sys/dev/pci/drm/amd/amdgpu/amdgpu_pm.c
@@ -446,8 +446,11 @@ static ssize_t amdgpu_get_pp_num_states(struct device *dev,
ret = smu_get_power_num_states(&adev->smu, &data);
if (ret)
return ret;
- } else if (adev->powerplay.pp_funcs->get_pp_num_states)
+ } else if (adev->powerplay.pp_funcs->get_pp_num_states) {
amdgpu_dpm_get_pp_num_states(adev, &data);
+ } else {
+ memset(&data, 0, sizeof(data));
+ }
pm_runtime_mark_last_busy(ddev->dev);
pm_runtime_put_autosuspend(ddev->dev);