All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] drm/amdgpu: fix uninitialized return value
@ 2021-05-11 17:25 ts8060
  2021-05-11 18:13 ` Alex Deucher
  0 siblings, 1 reply; 9+ messages in thread
From: ts8060 @ 2021-05-11 17:25 UTC (permalink / raw)
  To: amd-gfx; +Cc: alexander.deucher, airlied, christian.koenig, daniel

The amdgpu_display_suspend_helper() function uses an uninitialized
variable as its return value, causing a failure to suspend/resume on a
Radeon R7 240/340 GPU, with the following error in dmesg:
[drm:amdgpu_device_ip_suspend_phase1 [amdgpu]] *ERROR* suspend of IP block <dce_v6_0> failed 118489088

Initialize the variable to 0.

Signed-off-by: Tim Saunders <ts8060@my.bristol.ac.uk>
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_display.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_display.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_display.c
index 8a1fb8b6606e..27626d8a0647 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_display.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_display.c
@@ -1544,7 +1544,7 @@ int amdgpu_display_suspend_helper(struct amdgpu_device *adev)
        struct drm_crtc *crtc;
        struct drm_connector *connector;
        struct drm_connector_list_iter iter;
-       int r;
+       int r = 0;

        /* turn off display hw */
        drm_modeset_lock_all(dev);
--
2.31.1
_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

^ permalink raw reply related	[flat|nested] 9+ messages in thread
* [PATCH] drm/amdgpu: Fix uninitialized return value
@ 2023-11-27 18:29 Lijo Lazar
  2023-11-27 18:46 ` Christian König
  0 siblings, 1 reply; 9+ messages in thread
From: Lijo Lazar @ 2023-11-27 18:29 UTC (permalink / raw)
  To: amd-gfx; +Cc: Alexander.Deucher, Hawking.Zhang

The return value is uniinitialized if ras context is NULL.

Fixes: 0f4c8faa043c (drm/amdgpu: Move mca debug mode decision to ras)

Signed-off-by: Lijo Lazar <lijo.lazar@amd.com>
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c
index 1a8668a63e67..f6b47ebce9d6 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c
@@ -3410,7 +3410,7 @@ int amdgpu_ras_reset_gpu(struct amdgpu_device *adev)
 int amdgpu_ras_set_mca_debug_mode(struct amdgpu_device *adev, bool enable)
 {
 	struct amdgpu_ras *con = amdgpu_ras_get_context(adev);
-	int ret;
+	int ret = 0;
 
 	if (con) {
 		ret = amdgpu_mca_smu_set_debug_mode(adev, enable);
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2023-11-28 15:00 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-05-11 17:25 [PATCH] drm/amdgpu: fix uninitialized return value ts8060
2021-05-11 18:13 ` Alex Deucher
2023-11-27 18:29 [PATCH] drm/amdgpu: Fix " Lijo Lazar
2023-11-27 18:46 ` Christian König
2023-11-27 21:55   ` Alex Deucher
2023-11-28  9:37     ` Christian König
2023-11-28  9:49       ` Lazar, Lijo
2023-11-28 13:18         ` Christian König
2023-11-28 15:00           ` Felix Kuehling

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.