summaryrefslogtreecommitdiff
path: root/sys/dev/pci/drm/amd/amdkfd
diff options
context:
space:
mode:
authorJonathan Gray <jsg@cvs.openbsd.org>2024-05-20 04:50:57 +0000
committerJonathan Gray <jsg@cvs.openbsd.org>2024-05-20 04:50:57 +0000
commit315ebab76069095bec10f458de54cfaa03bbb67b (patch)
tree3f0243e9a720c9847ec3a6734134ed519b3f0c2a /sys/dev/pci/drm/amd/amdkfd
parent56ca454fe2dee062e19f869eedfbafb32473c7cd (diff)
drm/amdkfd: Check cgroup when returning DMABuf info
From Mukul Joshi d644962423704441713be6669b9544beed5d4176 in linux-6.6.y/6.6.31 9d7993a7ab9651afd5fb295a4992e511b2b727aa in mainline linux
Diffstat (limited to 'sys/dev/pci/drm/amd/amdkfd')
-rw-r--r--sys/dev/pci/drm/amd/amdkfd/kfd_chardev.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/sys/dev/pci/drm/amd/amdkfd/kfd_chardev.c b/sys/dev/pci/drm/amd/amdkfd/kfd_chardev.c
index 4fbdc942cb4..f22b4cda939 100644
--- a/sys/dev/pci/drm/amd/amdkfd/kfd_chardev.c
+++ b/sys/dev/pci/drm/amd/amdkfd/kfd_chardev.c
@@ -1516,7 +1516,7 @@ static int kfd_ioctl_get_dmabuf_info(struct file *filep,
/* Find a KFD GPU device that supports the get_dmabuf_info query */
for (i = 0; kfd_topology_enum_kfd_devices(i, &dev) == 0; i++)
- if (dev)
+ if (dev && !kfd_devcgroup_check_permission(dev))
break;
if (!dev)
return -EINVAL;
@@ -1538,7 +1538,7 @@ static int kfd_ioctl_get_dmabuf_info(struct file *filep,
if (xcp_id >= 0)
args->gpu_id = dmabuf_adev->kfd.dev->nodes[xcp_id]->id;
else
- args->gpu_id = dmabuf_adev->kfd.dev->nodes[0]->id;
+ args->gpu_id = dev->id;
args->flags = flags;
/* Copy metadata buffer to user mode */