summaryrefslogtreecommitdiff
path: root/kernel/trace
diff options
context:
space:
mode:
authorSteven Rostedt (Red Hat) <rostedt@goodmis.org>2016-03-08 17:17:15 -0500
committerSteven Rostedt <rostedt@goodmis.org>2016-04-19 18:56:05 -0400
commitd50c744ecde7ee3ba4d7ffb0e1c55e7a2f6bbc8e (patch)
treee1f246a1ee69683eb2a87298e35dad1ae327591d /kernel/trace
parent93c5f671f25cb7a73492b7a96b426c4fb1efa715 (diff)
downloadlinux-sh-d50c744ecde7ee3ba4d7ffb0e1c55e7a2f6bbc8e.tar.gz
tracing: Fix unsigned comparison to zero in hist trigger code
Fengguang Wu's bot found two comparisons of unsigned integers to zero. These were real bugs, as it would miss error conditions returned to zero. trace_events_hist.c:426:6-9: WARNING: Unsigned expression compared with zero: idx < 0 trace_events_hist.c:568:5-14: WARNING: Unsigned expression compared with zero: n_entries < 0 Reported-by: kbuild test robot <fengguang.wu@intel.com> Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
Diffstat (limited to 'kernel/trace')
-rw-r--r--kernel/trace/trace_events_hist.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/kernel/trace/trace_events_hist.c b/kernel/trace/trace_events_hist.c
index 23df38aab503..f98b6b3a2804 100644
--- a/kernel/trace/trace_events_hist.c
+++ b/kernel/trace/trace_events_hist.c
@@ -734,7 +734,7 @@ static int create_tracing_map_fields(struct hist_trigger_data *hist_data)
struct tracing_map *map = hist_data->map;
struct ftrace_event_field *field;
struct hist_field *hist_field;
- unsigned int i, idx;
+ int i, idx;
for_each_hist_field(i, hist_data) {
hist_field = hist_data->fields[i];
@@ -1036,7 +1036,7 @@ static int print_entries(struct seq_file *m,
{
struct tracing_map_sort_entry **sort_entries = NULL;
struct tracing_map *map = hist_data->map;
- unsigned int i, n_entries;
+ int i, n_entries;
n_entries = tracing_map_sort_entries(map, hist_data->sort_keys,
hist_data->n_sort_keys,