]> git.baikalelectronics.ru Git - kernel.git/commit
tracing/histogram: Fix check for missing operands in an expression
authorKalesh Singh <kaleshsingh@google.com>
Fri, 12 Nov 2021 19:13:24 +0000 (11:13 -0800)
committerSteven Rostedt (VMware) <rostedt@goodmis.org>
Fri, 12 Nov 2021 20:55:59 +0000 (15:55 -0500)
commit9c0abeaa731810c4be6663a6be30f22755968e9c
tree11476bdb7fd62f116e55dd67f92ea9c92bd9100e
parent7efd1d9dc9df1b045f5d98396e2cd17b1d453447
tracing/histogram: Fix check for missing operands in an expression

If a binary operation is detected while parsing an expression string,
the operand strings are deduced by splitting the experssion string at
the position of the detected binary operator. Both operand strings are
sub-strings (can be empty string) of the expression string but will
never be NULL.

Currently a NULL check is used for missing operands, fix this by
checking for empty strings instead.

Link: https://lkml.kernel.org/r/20211112191324.1302505-1-kaleshsingh@google.com
Signed-off-by: Kalesh Singh <kaleshsingh@google.com>
Fixes: dfdca7209867 ("tracing: Fix operator precedence for hist triggers expression")
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
kernel/trace/trace_events_hist.c