Skip to content

Commit 4d25342

Browse files
ShuichengLinrodrigovivi
authored andcommitted
drm/xe/oa: Fix exec_queue leak on width check in stream open
In xe_oa_stream_open_ioctl(), when param.exec_q->width > 1 the function returns -EOPNOTSUPP directly, skipping the existing err_exec_q cleanup path. The exec_queue reference obtained by xe_exec_queue_lookup() is leaked. The exec queue holds a reference on the xe_file, which is only dropped during queue teardown. The leaked lookup ref is not on the file's exec_queue xarray, so file close cannot release it. This keeps both the exec queue and the file private state pinned indefinitely. Jump to err_exec_q instead of returning directly so the reference is released. Fixes: f0ed398 ("xe/oa: Fix query mode of operation for OAR/OAC") Assisted-by: Claude:claude-opus-4.6 Reviewed-by: Ashutosh Dixit <ashutosh.dixit@intel.com> Link: https://patch.msgid.link/20260514203210.593488-1-shuicheng.lin@intel.com Signed-off-by: Shuicheng Lin <shuicheng.lin@intel.com> (cherry picked from commit 339fa0b) Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
1 parent 00907da commit 4d25342

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

drivers/gpu/drm/xe/xe_oa.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2032,8 +2032,10 @@ int xe_oa_stream_open_ioctl(struct drm_device *dev, u64 data, struct drm_file *f
20322032
if (XE_IOCTL_DBG(oa->xe, !param.exec_q))
20332033
return -ENOENT;
20342034

2035-
if (XE_IOCTL_DBG(oa->xe, param.exec_q->width > 1))
2036-
return -EOPNOTSUPP;
2035+
if (XE_IOCTL_DBG(oa->xe, param.exec_q->width > 1)) {
2036+
ret = -EOPNOTSUPP;
2037+
goto err_exec_q;
2038+
}
20372039
}
20382040

20392041
/*

0 commit comments

Comments
 (0)