Skip to contentSkip to conversation

drm/amdgpu/vi: silence an uninitialized variable warning

PATCH Applied Dan Carpenter 2 participants 2 messages Oct 17, 2019

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 drm/amdgpu/vi: silence an uninitialized variable warning

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")
---
 drivers/gpu/drm/amd/powerplay/amd_powerplay.c | 1 +
 1 file changed, 1 insertion(+)
drivers/gpu/drm/amd/powerplay/amd_powerplay.c +1 -0
index 83196b79edd5..f4ff15378e61 100644
@@ -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;
 
Signature · 6 lines
2.20.1

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
Applied
#1 lore raw
Quoted 9 lines · Dan Carpenter

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")

Applied. thanks!

Alex

Quoted 19 lines
---
 drivers/gpu/drm/amd/powerplay/amd_powerplay.c | 1 +
 1 file changed, 1 insertion(+)
drivers/gpu/drm/amd/powerplay/amd_powerplay.c +1 -1
index 83196b79edd5..f4ff15378e61 100644
@@ -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;
 
--

2.20.1

Quoted 4 lines

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx