Skip to content

Commit 2450a69

Browse files
siddhpantgregkh
authored andcommitted
Revert "tracing/trigger: Fix to return error if failed to alloc snapshot"
This reverts commit 8ffd559 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]>
1 parent 93eb31e commit 2450a69

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
@@ -1140,10 +1140,8 @@ register_snapshot_trigger(char *glob, struct event_trigger_ops *ops,
11401140
struct event_trigger_data *data,
11411141
struct trace_event_file *file)
11421142
{
1143-
int ret = tracing_alloc_snapshot_instance(file->tr);
1144-
1145-
if (ret < 0)
1146-
return ret;
1143+
if (tracing_alloc_snapshot_instance(file->tr) != 0)
1144+
return 0;
11471145

11481146
return register_trigger(glob, ops, data, file);
11491147
}

0 commit comments

Comments
 (0)