drm/amdgpu/vi: silence an uninitialized variable warning
authorDan Carpenter <dan.carpenter@oracle.com>
Thu, 17 Oct 2019 09:12:16 +0000 (12:12 +0300)
committerAlex Deucher <alexander.deucher@amd.com>
Fri, 25 Oct 2019 20:15:00 +0000 (16:15 -0400)
Smatch complains that we need to initialized "*cap" otherwise it can
lead to an uninitialized variable bug in the caller.  This seems like a
reasonable warning and it doesn't hurt to silence it at least.

drivers/gpu/drm/amd/amdgpu/vi.c:767 vi_asic_reset_method() error: uninitialized symbol 'baco_reset'.

Fixes: 425db2553e43 ("drm/amdgpu: expose BACO interfaces to upper level from PP")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/powerplay/amd_powerplay.c

index 83196b79edd52e83192f226a92721755e6c09648..f4ff15378e61b478987f552124e7cebe24ad4b60 100644 (file)
@@ -1421,6 +1421,7 @@ static int pp_get_asic_baco_capability(void *handle, bool *cap)
 {
        struct pp_hwmgr *hwmgr = handle;
 
+       *cap = false;
        if (!hwmgr)
                return -EINVAL;