Files
linux/kernel
Zilin Guan dc387c6def tracing: Fix memory leaks in create_field_var()
[ Upstream commit 80f0d631dc ]

The function create_field_var() allocates memory for 'val' through
create_hist_field() inside parse_atom(), and for 'var' through
create_var(), which in turn allocates var->type and var->var.name
internally. Simply calling kfree() to release these structures will
result in memory leaks.

Use destroy_hist_field() to properly free 'val', and explicitly release
the memory of var->type and var->var.name before freeing 'var' itself.

Link: https://patch.msgid.link/20251106120132.3639920-1-zilin@seu.edu.cn
Fixes: 02205a6752 ("tracing: Add support for 'field variables'")
Signed-off-by: Zilin Guan <zilin@seu.edu.cn>
Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2025-11-13 15:34:39 -05:00
..
2024-06-15 10:43:06 -07:00
2025-06-27 11:11:45 +01:00
2024-07-29 10:45:54 -07:00
2024-10-09 12:47:19 -07:00
2024-09-03 21:15:26 -07:00
2024-09-27 08:18:43 -07:00
2023-12-29 12:22:29 -08:00
2024-05-30 15:31:38 -07:00