Thread (20 messages) flat view 20 messages, 3 authors, 2025-03-03

Re: [PATCH 4/8] tracing: probe-events: Log errro for exceeding the number of arguments

From: Masami Hiramatsu (Google) <mhiramat@kernel.org>
Date: 2025-02-27 00:19:09
Also in: linux-kselftest, lkml

On Wed, 26 Feb 2025 17:13:17 +0100
Markus Elfring [off-list ref] wrote:
quoted
+++ b/kernel/trace/trace_fprobe.c
@@ -1201,8 +1201,11 @@ static int trace_fprobe_create_internal(int argc, const char *argv[],
 		argc = new_argc;
 		argv = new_argv;
 	}
-	if (argc > MAX_TRACE_ARGS)
+	if (argc > MAX_TRACE_ARGS) {
+		trace_probe_log_set_index(2);
+		trace_probe_log_err(0, TOO_MANY_ARGS);
 		return -E2BIG;
+	}

 	ret = traceprobe_expand_dentry_args(argc, argv, &dbuf);
…

May a bit of exception handling code be shared by an additional jump target?
Will another goto chain become helpful here?
Honestly, I don't want to introduce jump any more.

How do you think about to avoid a typo in the summary phrase?
Ah, I added too much 'e' :-D Will fix it.

Thanks,
Regards,
Markus

-- 
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