Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge tag 'trace-v6.14-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/trace/linux-trace

Pull tracing fix from Steven Rostedt:
"Fix ref count of trace_array in error path of histogram file open

Tracing instances have a ref count to keep them around while files
within their directories are open. This prevents them from being
deleted while they are used.

The histogram code had some files that needed to take the ref count
and that was added, but the error paths did not decrement the ref
counts. This caused the instances from ever being removed if a
histogram file failed to open due to some error"

* tag 'trace-v6.14-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/trace/linux-trace:
tracing: Correct the refcount if the hist/hist_debug file fails to open

+18 -6
+18 -6
kernel/trace/trace_events_hist.c
··· 5689 5689 guard(mutex)(&event_mutex); 5690 5690 5691 5691 event_file = event_file_data(file); 5692 - if (!event_file) 5693 - return -ENODEV; 5692 + if (!event_file) { 5693 + ret = -ENODEV; 5694 + goto err; 5695 + } 5694 5696 5695 5697 hist_file = kzalloc(sizeof(*hist_file), GFP_KERNEL); 5696 - if (!hist_file) 5697 - return -ENOMEM; 5698 + if (!hist_file) { 5699 + ret = -ENOMEM; 5700 + goto err; 5701 + } 5698 5702 5699 5703 hist_file->file = file; 5700 5704 hist_file->last_act = get_hist_hit_count(event_file); ··· 5706 5702 /* Clear private_data to avoid warning in single_open() */ 5707 5703 file->private_data = NULL; 5708 5704 ret = single_open(file, hist_show, hist_file); 5709 - if (ret) 5705 + if (ret) { 5710 5706 kfree(hist_file); 5707 + goto err; 5708 + } 5711 5709 5710 + return 0; 5711 + err: 5712 + tracing_release_file_tr(inode, file); 5712 5713 return ret; 5713 5714 } 5714 5715 ··· 5988 5979 5989 5980 /* Clear private_data to avoid warning in single_open() */ 5990 5981 file->private_data = NULL; 5991 - return single_open(file, hist_debug_show, file); 5982 + ret = single_open(file, hist_debug_show, file); 5983 + if (ret) 5984 + tracing_release_file_tr(inode, file); 5985 + return ret; 5992 5986 } 5993 5987 5994 5988 const struct file_operations event_hist_debug_fops = {