Re: [PATCH 5/5] tracing: uprobe-event: Allocate string buffers from heap
From: Google
Date: Fri Jul 18 2025 - 21:13:28 EST
On Fri, 18 Jul 2025 13:58:46 -0400
Steven Rostedt <rostedt@xxxxxxxxxxx> wrote:
> > + buf = kmalloc(MAX_EVENT_NAME_LEN, GFP_KERNEL);
> > + if (!buf) {
> > + ret = -ENOMEM;
> > + goto fail_address_parse;
> > + }
> > snprintf(buf, MAX_EVENT_NAME_LEN, "%c_%s_0x%lx", 'p', tail, offset);
> > event = buf;
> > kfree(tail);
>
> You could easily do the same thing as I mentioned in my reply to patch 4:
>
> if (!buf)
> goto fail_mem;
>
> error:
> free_trace_uprobe(tu);
> out:
> trace_probe_log_clear();
> return ret;
>
> fail_mem:
> ret = -ENOMEM;
> fail_address_parse:
> trace_probe_log_clear();
> path_put(&path);
> kfree(filename);
>
> return ret;
> }
OK, let me update it. Thanks!
>
> -- Steve
--
Masami Hiramatsu (Google) <mhiramat@xxxxxxxxxx>