aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/amd/amdgpu/amdgpu_userq_fence.c
diff options
context:
space:
mode:
authorArunpravin Paneer Selvam <[email protected]>2024-12-09 17:32:28 +0000
committerAlex Deucher <[email protected]>2025-04-08 20:48:19 +0000
commitc9e20cb005fdb6a727dc1a85d7192a35eeb11987 (patch)
tree9b3620777f59f7f2ccf2be07fb2004d648323c31 /drivers/gpu/drm/amd/amdgpu/amdgpu_userq_fence.c
parentdrm/amdgpu: Add mqd for userq compute queue (diff)
downloadkernel-c9e20cb005fdb6a727dc1a85d7192a35eeb11987.tar.gz
kernel-c9e20cb005fdb6a727dc1a85d7192a35eeb11987.zip
drm/amdgpu: Fix NULL ptr dereference issue for non userq fences
Add the correct fences count variable [num_fences] in the fences array iteration to handle the userq / non-userq fences. v2:(Christian) - All fences in the array either come from some reservation object or drm_syncobj. If any of those are NULL then there is a bug somewhere else. Signed-off-by: Arunpravin Paneer Selvam <[email protected]> Reviewed-by: Christian König <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
Diffstat (limited to 'drivers/gpu/drm/amd/amdgpu/amdgpu_userq_fence.c')
-rw-r--r--drivers/gpu/drm/amd/amdgpu/amdgpu_userq_fence.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_userq_fence.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_userq_fence.c
index 20c36dc97c2e..8a4d9495f9d7 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_userq_fence.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_userq_fence.c
@@ -817,7 +817,7 @@ int amdgpu_userq_wait_ioctl(struct drm_device *dev, void *data,
fences[num_fences++] = fence;
}
- for (i = 0, cnt = 0; i < wait_info->num_fences; i++) {
+ for (i = 0, cnt = 0; i < num_fences; i++) {
struct amdgpu_userq_fence_driver *fence_drv;
struct amdgpu_userq_fence *userq_fence;
u32 index;