[PATCH] drm/amdgpu: Fix uninitialized return value
Lijo Lazar
lijo.lazar at amd.com
Mon Nov 27 18:29:45 UTC 2023
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 at 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
More information about the amd-gfx
mailing list