Skip to content

Commit c5dd28e

Browse files
Yuuoniyrostedt
authored andcommitted
tracing: Fix error handling in event_trigger_parse()
According to trigger_data_alloc() doc, trigger_data_free() should be used to free an event_trigger_data object. This fixes a mismatch introduced when kzalloc was replaced with trigger_data_alloc without updating the corresponding deallocation calls. Cc: Masami Hiramatsu <[email protected]> Cc: Mark Rutland <[email protected]> Cc: Andrew Morton <[email protected]> Cc: Mathieu Desnoyers <[email protected]> Cc: Tom Zanussi <[email protected]> Link: https://lore.kernel.org/[email protected] Link: https://lore.kernel.org/[email protected] Fixes: e1f187d ("tracing: Have existing event_command.parse() implementations use helpers") Signed-off-by: Miaoqian Lin <[email protected]> [ SDR: Changed event_trigger_alloc/free() to trigger_data_alloc/free() ] Signed-off-by: Steven Rostedt (Google) <[email protected]>
1 parent f2947c4 commit c5dd28e

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

kernel/trace/trace_events_trigger.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -995,7 +995,7 @@ event_trigger_parse(struct event_command *cmd_ops,
995995

996996
if (remove) {
997997
event_trigger_unregister(cmd_ops, file, glob+1, trigger_data);
998-
kfree(trigger_data);
998+
trigger_data_free(trigger_data);
999999
ret = 0;
10001000
goto out;
10011001
}
@@ -1022,7 +1022,7 @@ event_trigger_parse(struct event_command *cmd_ops,
10221022

10231023
out_free:
10241024
event_trigger_reset_filter(cmd_ops, trigger_data);
1025-
kfree(trigger_data);
1025+
trigger_data_free(trigger_data);
10261026
goto out;
10271027
}
10281028

0 commit comments

Comments
 (0)