tracing/probe: Verify alloc_trace_*probe() result
[linux-2.6-microblaze.git] / kernel / trace / trace_uprobe.c
index e335576..b54137e 100644 (file)
@@ -266,10 +266,7 @@ alloc_trace_uprobe(const char *group, const char *event, int nargs, bool is_ret)
 {
        struct trace_uprobe *tu;
 
-       if (!event || !is_good_name(event))
-               return ERR_PTR(-EINVAL);
-
-       if (!group || !is_good_name(group))
+       if (!event || !group)
                return ERR_PTR(-EINVAL);
 
        tu = kzalloc(SIZEOF_TRACE_UPROBE(nargs), GFP_KERNEL);
@@ -517,8 +514,9 @@ static int trace_uprobe_create(int argc, const char **argv)
 
        tu = alloc_trace_uprobe(group, event, argc, is_return);
        if (IS_ERR(tu)) {
-               pr_info("Failed to allocate trace_uprobe.(%d)\n", (int)PTR_ERR(tu));
                ret = PTR_ERR(tu);
+               /* This must return -ENOMEM otherwise there is a bug */
+               WARN_ON_ONCE(ret != -ENOMEM);
                goto fail_address_parse;
        }
        tu->offset = offset;