All of lore.kernel.org
 help / color / mirror / Atom feed
* [bug report] tracing: Rewrite filter logic to be simpler and faster
@ 2018-03-27  7:30 Dan Carpenter
  2018-03-27 13:59 ` Steven Rostedt
  2018-03-27 14:25 ` Dan Carpenter
  0 siblings, 2 replies; 3+ messages in thread
From: Dan Carpenter @ 2018-03-27  7:30 UTC (permalink / raw)
  To: kernel-janitors

Hello Steven Rostedt (VMware),

The patch 80765597bc58: "tracing: Rewrite filter logic to be simpler
and faster" from Mar 9, 2018, leads to the following static checker
warning:

    kernel/trace/trace_events_filter.c:1794 apply_event_filter()
    error: uninitialized symbol 'filter'.

    kernel/trace/trace_events_filter.c:2052 ftrace_profile_set_filter()
    error: uninitialized symbol 'filter'.

kernel/trace/trace_events_filter.c
  1686  /**
  1687   * create_filter - create a filter for a trace_event_call
  1688   * @call: trace_event_call to create a filter for
  1689   * @filter_str: filter string
  1690   * @set_str: remember @filter_str and enable detailed error in filter
  1691   * @filterp: out param for created filter (always updated on return)
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
filterp is supposed to get updated.

  1692   *
  1693   * Creates a filter for @call with @filter_str.  If @set_str is %true,
  1694   * @filter_str is copied and recorded in the new filter.
  1695   *
  1696   * On success, returns 0 and *@filterp points to the new filter.  On
  1697   * failure, returns -errno and *@filterp may point to %NULL or to a new
  1698   * filter.  In the latter case, the returned filter contains error
  1699   * information if @set_str is %true and the caller is responsible for
  1700   * freeing it.
  1701   */
  1702  static int create_filter(struct trace_event_call *call,
  1703                           char *filter_string, bool set_str,
  1704                           struct event_filter **filterp)
  1705  {
  1706          struct filter_parse_error *pe = NULL;
  1707          struct event_filter *filter = NULL;
  1708          int err;
  1709  
  1710          err = create_filter_start(filter_string, set_str, &pe, &filter);
  1711          if (err)
  1712                  return err;
                        ^^^^^^^^^^^
But it's not on this new error path.

  1713  
  1714          err = process_preds(call, filter_string, filter, pe);
  1715          if (err && set_str)
  1716                  append_filter_err(pe, filter);
  1717  
  1718          *filterp = filter;
  1719          return err;
  1720  }


regards,
dan carpenter

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2018-03-27 14:25 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-03-27  7:30 [bug report] tracing: Rewrite filter logic to be simpler and faster Dan Carpenter
2018-03-27 13:59 ` Steven Rostedt
2018-03-27 14:25 ` Dan Carpenter

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.