linux/drivers/hwtracing/intel_th
Guangshuo Li 761b785a0c intel_th: fix MSC output device reference leak
intel_th_output_open() looks up the output device with
bus_find_device_by_devt(), which returns the device with a reference that
must be dropped after use.

commit 95fc36a234 ("intel_th: fix device leak on output open()")
attempted to drop the reference from intel_th_output_release(). However,
a successful open replaces file->f_op with the output driver file
operations before returning, so close runs the output driver release
callback instead.

For MSC outputs, close runs intel_th_msc_release(), which only removes
the per-file iterator and does not drop the device reference taken by
intel_th_output_open(). Consequently, every successful MSC output open
leaks one device reference.

Drop the device reference from intel_th_msc_release(), which is the
release path actually used for MSC output files. Remove the now-unused
intel_th_output_release() callback from intel_th_output_fops.

Fixes: 95fc36a234 ("intel_th: fix device leak on output open()")
Cc: stable <stable@kernel.org>
Signed-off-by: Guangshuo Li <lgs201920130244@gmail.com>
Reviewed-by: Johan Hovold <johan@kernel.org>
Link: https://patch.msgid.link/20260715070851.2077965-1-lgs201920130244@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2026-07-17 14:52:08 +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 MSC output device reference leak 2026-07-17 14:52:08 +02:00
debug.c
debug.h
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
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
msu-sink.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
msu.c intel_th: fix MSC output device reference leak 2026-07-17 14:52:08 +02:00
msu.h Merge 5.3-rc5 into char-misc-next 2019-08-19 07:11:53 +02:00
pci_ids.h intel_th: pci: Add Nova Lake support 2026-01-27 15:54:18 +01:00
pci.c intel_th: pci: Add Nova Lake support 2026-01-27 15:54:18 +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