mirror of
https://github.com/torvalds/linux.git
synced 2026-03-08 00:44:31 +01:00
drm/amdgpu/userq: Consolidate wait ioctl exit path
If we gate the fence destruction with a check telling us whether there are valid pointers in there we can eliminate the need for dual, basically identical, exit paths. Reviewed-by: Alex Deucher <alexander.deucher@amd.com> Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@igalia.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com> (cherry picked from commit bea29bb0dd29012949cd44fdb122465a9fd5cf91)
This commit is contained in:
parent
a145bbff6f
commit
048c1c4e51
1 changed files with 5 additions and 23 deletions
|
|
@ -983,32 +983,14 @@ int amdgpu_userq_wait_ioctl(struct drm_device *dev, void *data,
|
|||
r = -EFAULT;
|
||||
goto free_fences;
|
||||
}
|
||||
|
||||
kfree(fences);
|
||||
kfree(fence_info);
|
||||
}
|
||||
|
||||
drm_exec_fini(&exec);
|
||||
for (i = 0; i < num_read_bo_handles; i++)
|
||||
drm_gem_object_put(gobj_read[i]);
|
||||
kfree(gobj_read);
|
||||
|
||||
for (i = 0; i < num_write_bo_handles; i++)
|
||||
drm_gem_object_put(gobj_write[i]);
|
||||
kfree(gobj_write);
|
||||
|
||||
kfree(timeline_points);
|
||||
kfree(timeline_handles);
|
||||
kfree(syncobj_handles);
|
||||
kfree(bo_handles_write);
|
||||
kfree(bo_handles_read);
|
||||
|
||||
return 0;
|
||||
|
||||
free_fences:
|
||||
while (num_fences-- > 0)
|
||||
dma_fence_put(fences[num_fences]);
|
||||
kfree(fences);
|
||||
if (fences) {
|
||||
while (num_fences-- > 0)
|
||||
dma_fence_put(fences[num_fences]);
|
||||
kfree(fences);
|
||||
}
|
||||
free_fence_info:
|
||||
kfree(fence_info);
|
||||
exec_fini:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue