mirror-linux/drivers/hwtracing/intel_th
Ma Ke 6d5925b667 intel_th: Fix error handling in intel_th_output_open
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>
2025-11-26 15:10:03 +01:00
..
Kconfig intel_th: avoid using deprecated page->mapping, index fields 2025-04-15 13:29:03 +02:00
Makefile intel_th: msu-sink: An example msu buffer "sink" 2019-07-25 13:03:18 +02:00
acpi.c Get rid of 'remove_new' relic from platform driver struct 2024-12-01 15:12:43 -08:00
core.c intel_th: Fix error handling in intel_th_output_open 2025-11-26 15:10:03 +01:00
debug.c intel_th: Add SPDX GPL-2.0 header to replace GPLv2 boilerplate 2018-03-28 18:47:19 +03:00
debug.h intel_th: Add SPDX GPL-2.0 header to replace GPLv2 boilerplate 2018-03-28 18:47:19 +03:00
gth.c intel_th: Convert sprintf/snprintf to sysfs_emit 2024-05-04 18:57:22 +02:00
gth.h intel_th: Add switch triggering support 2019-05-03 18:16:21 +02:00
intel_th.h driver core: have match() callback in struct bus_type take a const * 2024-07-03 15:16:54 +02:00
msu-sink.c intel_th: msu-sink: add missing MODULE_DESCRIPTION() 2024-07-03 16:40:30 +02:00
msu.c mm: remove callers of pfn_t functionality 2025-07-09 22:42:19 -07:00
msu.h Merge 5.3-rc5 into char-misc-next 2019-08-19 07:11:53 +02:00
pci.c intel_th: pci: Add Panther Lake-P/U support 2025-02-20 09:35:57 +01:00
pti.c intel_th: Constify attribute_group structs 2021-04-16 07:26:50 +02:00
pti.h intel_th: Use the correct style for SPDX License Identifier 2019-07-30 19:41:53 +02:00
sth.c intel_th: Remove redundant initialization of pointer outp 2024-05-04 18:57:22 +02:00
sth.h intel_th: Add SPDX GPL-2.0 header to replace GPLv2 boilerplate 2018-03-28 18:47:19 +03:00