Revert "tracing: Correct the refcount if the hist/hist_debug file fails to open"
This reverts commit 41a2c7abc3
which is
commit 0b4ffbe4888a2c71185eaf5c1a02dd3586a9bc04 upstream.
It breaks the Android kernel abi and can be brought back in the future
in an abi-safe way if it is really needed.
Bug: 161946584
Change-Id: I04962daf09d16ecc5a95a3abf3469a8398fe7c3e
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
This commit is contained in:
@@ -5700,16 +5700,12 @@ static int event_hist_open(struct inode *inode, struct file *file)
|
||||
guard(mutex)(&event_mutex);
|
||||
|
||||
event_file = event_file_data(file);
|
||||
if (!event_file) {
|
||||
ret = -ENODEV;
|
||||
goto err;
|
||||
}
|
||||
if (!event_file)
|
||||
return -ENODEV;
|
||||
|
||||
hist_file = kzalloc(sizeof(*hist_file), GFP_KERNEL);
|
||||
if (!hist_file) {
|
||||
ret = -ENOMEM;
|
||||
goto err;
|
||||
}
|
||||
if (!hist_file)
|
||||
return -ENOMEM;
|
||||
|
||||
hist_file->file = file;
|
||||
hist_file->last_act = get_hist_hit_count(event_file);
|
||||
@@ -5717,14 +5713,9 @@ static int event_hist_open(struct inode *inode, struct file *file)
|
||||
/* Clear private_data to avoid warning in single_open() */
|
||||
file->private_data = NULL;
|
||||
ret = single_open(file, hist_show, hist_file);
|
||||
if (ret) {
|
||||
if (ret)
|
||||
kfree(hist_file);
|
||||
goto err;
|
||||
}
|
||||
|
||||
return 0;
|
||||
err:
|
||||
tracing_release_file_tr(inode, file);
|
||||
return ret;
|
||||
}
|
||||
|
||||
@@ -5999,10 +5990,7 @@ static int event_hist_debug_open(struct inode *inode, struct file *file)
|
||||
|
||||
/* Clear private_data to avoid warning in single_open() */
|
||||
file->private_data = NULL;
|
||||
ret = single_open(file, hist_debug_show, file);
|
||||
if (ret)
|
||||
tracing_release_file_tr(inode, file);
|
||||
return ret;
|
||||
return single_open(file, hist_debug_show, file);
|
||||
}
|
||||
|
||||
const struct file_operations event_hist_debug_fops = {
|
||||
|
Reference in New Issue
Block a user