Thread (10 messages) 10 messages, 3 authors, 2024-11-29

Re: [PATCH 6/6] tracing/dynevent: Adopt guard() and scoped_guard()

From: Steven Rostedt <rostedt@goodmis.org>
Date: 2024-11-28 16:58:00
Also in: lkml, llvm, oe-kbuild-all

On Thu, 28 Nov 2024 16:42:47 +0800
kernel test robot [off-list ref] wrote:
5448d44c38557f Masami Hiramatsu          2018-11-05   97  	p = strchr(event, '/');
5448d44c38557f Masami Hiramatsu          2018-11-05   98  	if (p) {
5448d44c38557f Masami Hiramatsu          2018-11-05   99  		system = event;
5448d44c38557f Masami Hiramatsu          2018-11-05  100  		event = p + 1;
5448d44c38557f Masami Hiramatsu          2018-11-05  101  		*p = '\0';
5448d44c38557f Masami Hiramatsu          2018-11-05  102  	}
95c104c378dc7d Linyu Yuan                2022-06-27  103  	if (!system && event[0] == '\0') {
8db403b9631331 Christophe JAILLET        2021-04-11  104  		ret = -EINVAL;
8db403b9631331 Christophe JAILLET        2021-04-11 @105  		goto out;
This is a legitimate bug. The "goto out" can't jump over a guard().

-- Steve

8db403b9631331 Christophe JAILLET        2021-04-11  106  	}
5448d44c38557f Masami Hiramatsu          2018-11-05  107  
79cc5c1710963f Masami Hiramatsu (Google  2024-11-26  108) 	guard(mutex)(&event_mutex);
5448d44c38557f Masami Hiramatsu          2018-11-05  109  	for_each_dyn_event_safe(pos, n) {
5448d44c38557f Masami Hiramatsu          2018-11-05  110  		if (type && type != pos->ops)
5448d44c38557f Masami Hiramatsu          2018-11-05  111  			continue;
30199137c899d7 Masami Hiramatsu          2019-06-20  112  		if (!pos->ops->match(system, event,
d262271d04830e Masami Hiramatsu          2021-02-01  113  				argc - 1, (const char **)argv + 1, pos))
cb8e7a8d55e052 Masami Hiramatsu          2019-06-20  114  			continue;
cb8e7a8d55e052 Masami Hiramatsu          2019-06-20  115  
5448d44c38557f Masami Hiramatsu          2018-11-05  116  		ret = pos->ops->free(pos);
cb8e7a8d55e052 Masami Hiramatsu          2019-06-20  117  		if (ret)
5448d44c38557f Masami Hiramatsu          2018-11-05  118  			break;
5448d44c38557f Masami Hiramatsu          2018-11-05  119  	}
4313e5a613049d Steven Rostedt (Google    2022-11-23  120) 	tracing_reset_all_online_cpus();
d262271d04830e Masami Hiramatsu          2021-02-01  121  out:
d262271d04830e Masami Hiramatsu          2021-02-01  122  	argv_free(argv);
5448d44c38557f Masami Hiramatsu          2018-11-05  123  	return ret;
5448d44c38557f Masami Hiramatsu          2018-11-05  124  }
5448d44c38557f Masami Hiramatsu          2018-11-05  125  
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help