Thread (17 messages) 17 messages, 2 authors, 2025-07-19

Re: [PATCH 5/5] tracing: uprobe-event: Allocate string buffers from heap

From: Masami Hiramatsu (Google) <mhiramat@kernel.org>
Date: 2025-07-19 01:13:20
Also in: lkml

On Fri, 18 Jul 2025 13:58:46 -0400
Steven Rostedt [off-list ref] wrote:
quoted
+		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) [off-list ref]
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help