linux/drivers/hwtracing
Ma Ke 4157f7bba6 intel_th: Fix error handling in intel_th_output_open
commit 6d5925b667 upstream.

intel_th_output_open() calls bus_find_device_by_devt() which
internally increments the device reference count via get_device(), but
this reference is not properly released in several error paths. When
device driver is unavailable, file operations cannot be obtained, or
the driver's open method fails, the function returns without calling
put_device(), leading to a permanent device reference count leak. This
prevents the device from being properly released and could cause
resource exhaustion over time.

Found by code review.

Cc: stable <stable@kernel.org>
Fixes: 39f4034693 ("intel_th: Add driver infrastructure for Intel(R) Trace Hub devices")
Signed-off-by: Ma Ke <make24@iscas.ac.cn>
Link: https://patch.msgid.link/20251112091723.35963-1-make24@iscas.ac.cn
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
History 2026-01-02 12:57:14 +01:00
..
coresight coresight: etm4x: Properly control filter in CPU idle with FEAT_TRF 2025-12-18 14:02:57 +01:00
intel_th intel_th: Fix error handling in intel_th_output_open 2026-01-02 12:57:14 +01:00
ptt hwtracing: hisi_ptt: Assign parent for event_source device 2024-05-02 11:36:11 +01:00
stm stm class: heartbeat: Switch to use hrtimer_setup() 2025-02-18 11:19:05 +01:00
Kconfig hwtracing: hisi_ptt: Add trace function support for HiSilicon PCIe Tune and Trace device 2022-09-08 16:26:17 -06:00