Skip to content

Commit ca4cee7

Browse files
siddhpantsmb49
authored andcommitted
Revert "tracing/trigger: Fix to return error if failed to alloc snapshot"
BugLink: https://bugs.launchpad.net/bugs/2067959 This reverts commit b5085b5ac1d96ea2a8a6240f869655176ce44197 which is commit 0958b33 upstream. The change has an incorrect assumption about the return value because in the current stable trees for versions 5.15 and before, the following commit responsible for making 0 a success value is not present: b8cc44a ("tracing: Remove logic for registering multiple event triggers at a time") The return value should be 0 on failure in the current tree, because in the functions event_trigger_callback() and event_enable_trigger_func(), we have: ret = cmd_ops->reg(glob, trigger_ops, trigger_data, file); /* * The above returns on success the # of functions enabled, * but if it didn't find any functions it returns zero. * Consider no functions a failure too. */ if (!ret) { ret = -ENOENT; Cc: [email protected] # 5.15, 5.10, 5.4, 4.19 Signed-off-by: Siddh Raman Pant <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]> Signed-off-by: Portia Stephens <[email protected]> Signed-off-by: Stefan Bader <[email protected]>
1 parent 579a81f commit ca4cee7

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

kernel/trace/trace_events_trigger.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1161,10 +1161,8 @@ register_snapshot_trigger(char *glob, struct event_trigger_ops *ops,
11611161
struct event_trigger_data *data,
11621162
struct trace_event_file *file)
11631163
{
1164-
int ret = tracing_alloc_snapshot_instance(file->tr);
1165-
1166-
if (ret < 0)
1167-
return ret;
1164+
if (tracing_alloc_snapshot_instance(file->tr) != 0)
1165+
return 0;
11681166

11691167
return register_trigger(glob, ops, data, file);
11701168
}

0 commit comments

Comments
 (0)