Commit 5834a597 authored by Ye Bin's avatar Ye Bin Committed by Steven Rostedt (Google)
Browse files

ftrace: Don't allocate ftrace module map if ftrace is disabled

If ftrace is disabled, it is meaningless to allocate a module map.
Add a check in allocate_ftrace_mod_map() to not allocate if ftrace is
disabled.

Link: https://lore.kernel.org/20250529111955.2349189-3-yebin@huaweicloud.com


Signed-off-by: default avatarYe Bin <yebin10@huawei.com>
Signed-off-by: default avatarSteven Rostedt (Google) <rostedt@goodmis.org>
parent f914b52c
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -7631,6 +7631,9 @@ allocate_ftrace_mod_map(struct module *mod,
{
	struct ftrace_mod_map *mod_map;

	if (ftrace_disabled)
		return NULL;

	mod_map = kmalloc(sizeof(*mod_map), GFP_KERNEL);
	if (!mod_map)
		return NULL;