Skip to content

Commit 8651fcb

Browse files
Tom Rixalexdeucher
authored andcommitted
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 <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
1 parent c69f271 commit 8651fcb

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/gpu/drm/amd/pm/amdgpu_pm.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -451,7 +451,7 @@ static ssize_t amdgpu_get_pp_cur_state(struct device *dev,
451451
struct drm_device *ddev = dev_get_drvdata(dev);
452452
struct amdgpu_device *adev = drm_to_adev(ddev);
453453
const struct amd_pm_funcs *pp_funcs = adev->powerplay.pp_funcs;
454-
struct pp_states_info data;
454+
struct pp_states_info data = {0};
455455
enum amd_pm_state_type pm = 0;
456456
int i = 0, ret = 0;
457457

0 commit comments

Comments
 (0)