tracing: Remove BUG_ON() from append_filter_string()
authorSteven Rostedt (VMware) <rostedt@goodmis.org>
Fri, 23 Feb 2018 03:32:51 +0000 (22:32 -0500)
committerSteven Rostedt (VMware) <rostedt@goodmis.org>
Sat, 10 Mar 2018 21:06:05 +0000 (16:06 -0500)
There's no reason to BUG if there's a bug in the filtering code. Simply do a
warning and return.

Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
kernel/trace/trace_events_filter.c

index a764aec3c9a17a386112b56326f188881babebe6..819a13c3e13cfbdf062a45332b983ea85d805153 100644 (file)
@@ -681,7 +681,8 @@ static int append_filter_string(struct event_filter *filter,
        int newlen;
        char *new_filter_string;
 
-       BUG_ON(!filter->filter_string);
+       if (WARN_ON(!filter->filter_string))
+               return -EINVAL;
        newlen = strlen(filter->filter_string) + strlen(string) + 1;
        new_filter_string = kmalloc(newlen, GFP_KERNEL);
        if (!new_filter_string)