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>
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,