Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

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>

authored by

Tvrtko Ursulin and committed by
Alex Deucher
bea29bb0 2c333ea5

+5 -23
+5 -23
drivers/gpu/drm/amd/amdgpu/amdgpu_userq_fence.c
··· 972 972 r = -EFAULT; 973 973 goto free_fences; 974 974 } 975 - 976 - kfree(fences); 977 - kfree(fence_info); 978 975 } 979 976 980 - drm_exec_fini(&exec); 981 - for (i = 0; i < num_read_bo_handles; i++) 982 - drm_gem_object_put(gobj_read[i]); 983 - kfree(gobj_read); 984 - 985 - for (i = 0; i < num_write_bo_handles; i++) 986 - drm_gem_object_put(gobj_write[i]); 987 - kfree(gobj_write); 988 - 989 - kfree(timeline_points); 990 - kfree(timeline_handles); 991 - kfree(syncobj_handles); 992 - kfree(bo_handles_write); 993 - kfree(bo_handles_read); 994 - 995 - return 0; 996 - 997 977 free_fences: 998 - while (num_fences-- > 0) 999 - dma_fence_put(fences[num_fences]); 1000 - kfree(fences); 978 + if (fences) { 979 + while (num_fences-- > 0) 980 + dma_fence_put(fences[num_fences]); 981 + kfree(fences); 982 + } 1001 983 free_fence_info: 1002 984 kfree(fence_info); 1003 985 exec_fini: