]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
drm/xe/oa: Fix sync entry leak on OA config emit failure
authorLinmao Li <lilinmao@kylinos.cn>
Fri, 31 Jul 2026 01:19:32 +0000 (09:19 +0800)
committerThomas Hellström <thomas.hellstrom@linux.intel.com>
Thu, 13 Aug 2026 12:56:33 +0000 (14:56 +0200)
commit8d33c4987cd162527375a3905017ae129ba7c3fe
tree7f90dfc01238a61c958077ae558bd6277561d0df
parentcb4afddf9e018a83fec8614d8e337d313871569f
drm/xe/oa: Fix sync entry leak on OA config emit failure

xe_oa_emit_oa_config() releases the sync entries and the syncs array
only on its success path. When it fails before the point of no return
(fence allocation, config buffer allocation or batch submission), it
returns without touching stream->syncs.

The stream open path handles such failures in the caller, but
xe_oa_config_locked() propagates the error without any cleanup, so the
syncs array and the fence references held by the parsed entries are
leaked. The next config ioctl overwrites stream->syncs, making the
memory unreachable for good.

Clean up the parsed syncs when xe_oa_emit_oa_config() fails, matching
the cleanup done by the stream open error path.

Fixes: 9920c8b88c5c ("drm/xe/oa: Add syncs support to OA config ioctl")
Signed-off-by: Linmao Li <lilinmao@kylinos.cn>
Reviewed-by: Ashutosh Dixit <ashutosh.dixit@intel.com>
Signed-off-by: Ashutosh Dixit <ashutosh.dixit@intel.com>
Link: https://patch.msgid.link/20260731011932.3426219-1-lilinmao@kylinos.cn
(cherry picked from commit 8af97b3da2cfce04e6b457c6eb17ed3c1daf912b)
Signed-off-by: Thomas Hellström <thomas.hellstrom@linux.intel.com>
drivers/gpu/drm/xe/xe_oa.c