diff options
author | Tom Rix <trix@redhat.com> | 2021-04-30 20:16:54 +0300 |
---|---|---|
committer | Alex Deucher <alexander.deucher@amd.com> | 2021-05-05 00:38:05 +0300 |
commit | 8651fcb9873be097bb6fe8542bfb6089020726ae (patch) | |
tree | 80d56f5041800814794c027df30a2abe44966700 /drivers/gpu | |
parent | c69f27137a38d24301a6b659454a91ad85dff4aa (diff) | |
download | linux-8651fcb9873be097bb6fe8542bfb6089020726ae.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')
-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 a8d6cc2525b2..e2ea42b1b4f0 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; |