Skip to content

Two tracing patches for trace_events_hist.c

Ammar Faizi linux-trace-devel lkml 2 versions New

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v1 Latest posting 2/22 patches 0 repliesNew
  2. v1 posting 1/22 patches 0 repliesSuperseded

Patches in v1 posting 2/2 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/2tracing: Return -EINVAL if WARN_ON(!glob) triggered in event_hist_trigger_parse()kernel/trace/trace_events_hist.c+2 -10 replies
2/2tracing: Change `if (strlen(glob))` to `if (glob[0])`kernel/trace/trace_events_hist.c+1 -10 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [RESEND PATCH 0/2] Two tracing patches for trace_events_hist.c

[ Sorry, this is a resend, I sent it to the wrong address of trace devel list. ]

Hi,

Two patches here.

## Patch 1
If WARN_ON(!glob) is ever triggered, we will still continue executing the next lines. This will trigger the more serious problem, a NULL pointer dereference bug. Just return -EINVAL if @glob is NULL.

## Patch 2
Change if (strlen(glob)) to if (glob[0]). No need to traverse to the end of string. If the first byte is not a NUL char, it's guaranteed if (strlen(glob)) is true.

---

Ammar Faizi (2):
tracing: Return -EINVAL if WARN_ON(!glob) triggered in event_hist_trigger_parse()
tracing: Change if (strlen(glob)) to if (glob[0])

 kernel/trace/trace_events_hist.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

base-commit: a1901b464e7e3e28956ae7423db2847dbbfb5be8

Signature · 1 line
Ammar Faizi