diff options
author | Tom Rix <trix@redhat.com> | 2021-04-30 20:16:54 +0300 |
---|---|---|
committer | Alex Deucher <alexander.deucher@amd.com> | 2021-05-11 01:06:45 +0300 |
commit | 2b24c199388e09afea5ca11c6284b320f2ae8ed6 (patch) | |
tree | db63238c1545e3b9ac2f000d3e05ee0cf9a5a3f5 /drivers/gpu/drm/amd/pm/amdgpu_pm.c | |
parent | 642f3ad00f9640a1a74c6e0da538c5f88d2d0117 (diff) | |
download | linux-2b24c199388e09afea5ca11c6284b320f2ae8ed6.tar.xz |
drm/amd/pm: initialize variable
Static analysis reports this problem
amdgpu_pm.c:478:16: warning: The right operand of '<' is a garbage value
for (i = 0; i < data.nums; i++) {
^ ~~~~~~~~~
In some cases data is not set. Initialize to 0 and flag not setting
data as an error with the existing check.
Signed-off-by: Tom Rix <trix@redhat.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'drivers/gpu/drm/amd/pm/amdgpu_pm.c')
-rw-r--r-- | drivers/gpu/drm/amd/pm/amdgpu_pm.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/gpu/drm/amd/pm/amdgpu_pm.c b/drivers/gpu/drm/amd/pm/amdgpu_pm.c index e054249e1497..f11cecdd70f6 100644 --- a/drivers/gpu/drm/amd/pm/amdgpu_pm.c +++ b/drivers/gpu/drm/amd/pm/amdgpu_pm.c @@ -451,7 +451,7 @@ static ssize_t amdgpu_get_pp_cur_state(struct device *dev, struct drm_device *ddev = dev_get_drvdata(dev); struct amdgpu_device *adev = drm_to_adev(ddev); const struct amd_pm_funcs *pp_funcs = adev->powerplay.pp_funcs; - struct pp_states_info data; + struct pp_states_info data = {0}; enum amd_pm_state_type pm = 0; int i = 0, ret = 0; |