Skip to content

Commit 5f8895b

Browse files
mhiramatrostedt
authored andcommitted
tracing/boot: Fix to check the histogram control param is a leaf node
Since xbc_node_find_child() doesn't ensure the returned node is a leaf node (key-value pair or do not have subkeys), use xbc_node_find_value to ensure the histogram control parameter is a leaf node in trace_boot_compose_hist_cmd(). Link: https://lkml.kernel.org/r/163119459059.161018.18341288218424528962.stgit@devnote2 Fixes: e66ed86 ("tracing/boot: Add per-event histogram action options") Signed-off-by: Masami Hiramatsu <[email protected]> Signed-off-by: Steven Rostedt (VMware) <[email protected]>
1 parent a3928f8 commit 5f8895b

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

kernel/trace/trace_boot.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -385,11 +385,11 @@ trace_boot_compose_hist_cmd(struct xbc_node *hnode, char *buf, size_t size)
385385
}
386386

387387
/* Histogram control attributes (mutual exclusive) */
388-
if (xbc_node_find_child(hnode, "pause"))
388+
if (xbc_node_find_value(hnode, "pause", NULL))
389389
append_printf(&buf, end, ":pause");
390-
else if (xbc_node_find_child(hnode, "continue"))
390+
else if (xbc_node_find_value(hnode, "continue", NULL))
391391
append_printf(&buf, end, ":continue");
392-
else if (xbc_node_find_child(hnode, "clear"))
392+
else if (xbc_node_find_value(hnode, "clear", NULL))
393393
append_printf(&buf, end, ":clear");
394394

395395
/* Histogram handler and actions */

0 commit comments

Comments
 (0)