Files
linux-stable-mirror/kernel
Zilin GuanandGreg Kroah-Hartman 38771ab159 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-12-07 06:09:26 +09:00
..
2024-07-05 09:14:34 +02:00
2023-12-20 15:17:37 +01:00
2025-06-27 11:05:38 +01:00
2023-11-28 16:56:16 +00:00
2024-10-17 15:12:00 +02:00
2024-04-10 16:19:01 +02:00
2024-10-17 15:11:27 +02:00