diff options
author | Dan Carpenter <dan.carpenter@linaro.org> | 2025-04-12 17:39:43 +0300 |
---|---|---|
committer | Alex Deucher <alexander.deucher@amd.com> | 2025-04-21 10:54:10 -0400 |
commit | 0e023c327b30ff306a7c08165a1ab9879c268226 (patch) | |
tree | eb2dbecc3cc96e7616531e0069af3bf6defccb42 /drivers/gpu/drm/amd/amdgpu | |
parent | 8ff7c78baeeab746432934f7de82d56706c00c50 (diff) |
drm/amdgpu: Clean up error handling in amdgpu_userq_fence_driver_alloc()
1) Checkpatch complains if we print an error message for kzalloc()
failure. The kzalloc() failure already has it's own error messages
built in. Also this allocation is small enough that it is guaranteed
to succeed.
2) Return directly instead of doing a goto free_fence_drv. The
"fence_drv" is already NULL so no cleanup is necessary.
Reviewed-by: Arvind Yadav <arvind.yadav@amd.com>
Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'drivers/gpu/drm/amd/amdgpu')
-rw-r--r-- | drivers/gpu/drm/amd/amdgpu/amdgpu_userq_fence.c | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_userq_fence.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_userq_fence.c index e2e0bd6ae807..0a3032e01c34 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_userq_fence.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_userq_fence.c @@ -75,11 +75,8 @@ int amdgpu_userq_fence_driver_alloc(struct amdgpu_device *adev, int r; fence_drv = kzalloc(sizeof(*fence_drv), GFP_KERNEL); - if (!fence_drv) { - DRM_ERROR("Failed to allocate memory for fence driver\n"); - r = -ENOMEM; - goto free_fence_drv; - } + if (!fence_drv) + return -ENOMEM; /* Acquire seq64 memory */ r = amdgpu_seq64_alloc(adev, &fence_drv->va, &fence_drv->gpu_addr, |