lkml.org 
[lkml]   [2021]   [May]   [24]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH -next] drm/amdgpu: fix error return code in amdgpu_acpi_init()
Date
Fix to return a negative error code from the error handling
case instead of 0, as done elsewhere in this function.

Fixes: 77bf762f8b30 ("drm/amdgpu/acpi: unify ATCS handling (v3)")
Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
---
drivers/gpu/drm/amd/amdgpu/amdgpu_acpi.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_acpi.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_acpi.c
index 49563ff87f1a..9564690b21b4 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_acpi.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_acpi.c
@@ -895,12 +895,15 @@ int amdgpu_acpi_init(struct amdgpu_device *adev)
atcs:
/* Probe for ATCS, and initialize it if found */
atcs_handle = amdgpu_atcs_probe_handle(handle);
- if (!atcs_handle)
+ if (!atcs_handle) {
+ ret = -ENODEV;
goto out;
+ }

atcs = kzalloc(sizeof(*atcs), GFP_KERNEL);
if (!atcs) {
DRM_WARN("Not enough memory to initialize ATCS\n");
+ ret = -ENOMEM;
goto out;
}
atcs->handle = atcs_handle;
\
 
 \ /
  Last update: 2021-05-24 15:25    [W:0.029 / U:0.340 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site