]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
drm/xe/eustall: Fix drm_dev_put called before stream disable in close
authorShuicheng Lin <shuicheng.lin@intel.com>
Wed, 15 Apr 2026 22:54:28 +0000 (22:54 +0000)
committerMatt Roper <matthew.d.roper@intel.com>
Thu, 16 Apr 2026 20:04:55 +0000 (13:04 -0700)
commit35aff528f7297e949e5e19c9cd7fd748cf1cf21c
treeeb073517454241ba00e89768f85f6074d6b774b8
parentc027f1a19180ea4e5aa29bab4e0871a21bb96c05
drm/xe/eustall: Fix drm_dev_put called before stream disable in close

In xe_eu_stall_stream_close(), drm_dev_put() is called before the
stream is disabled and its resources are freed. If this drops the
last reference, the device structures could be freed while the
subsequent cleanup code still accesses them, leading to a
use-after-free.

Fix this by moving drm_dev_put() after all device accesses are
complete. This matches the ordering in xe_oa_release().

Fixes: 9a0b11d4cf3b ("drm/xe/eustall: Add support to init, enable and disable EU stall sampling")
Cc: Harish Chegondi <harish.chegondi@intel.com>
Assisted-by: Claude:claude-opus-4.6
Signed-off-by: Shuicheng Lin <shuicheng.lin@intel.com>
Reviewed-by: Harish Chegondi <harish.chegondi@intel.com>
Link: https://patch.msgid.link/20260415225428.3399934-1-shuicheng.lin@intel.com
Signed-off-by: Matt Roper <matthew.d.roper@intel.com>
drivers/gpu/drm/xe/xe_eu_stall.c