linux/drivers/hwtracing
Ma Ke 4f3e0af0d9 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-19 13:09:51 +01:00
..
coresight coresight: etm4x: Correct polling IDLE bit 2026-01-19 13:09:40 +01:00
intel_th intel_th: Fix error handling in intel_th_output_open 2026-01-19 13:09:51 +01:00
stm stm class: Fix a double free in stm_register_device() 2024-06-16 13:39:39 +02:00
Kconfig treewide: Add SPDX license identifier - Makefile/Kconfig 2019-05-21 10:50:46 +02:00