diff options
| author | Malaya Kumar Rout <[email protected]> | 2025-11-20 15:02:13 +0000 |
|---|---|---|
| committer | Thomas Gleixner <[email protected]> | 2025-11-20 15:40:48 +0000 |
| commit | 7b5ab04f035f829ed6008e4685501ec00b3e73c9 (patch) | |
| tree | f28013914acd9cdc644462970e078b5c50f160c4 /tools/lib/traceevent/plugins/plugin_function.c | |
| parent | tick/sched: Fix bogus condition in report_idle_softirq() (diff) | |
| download | kernel-7b5ab04f035f829ed6008e4685501ec00b3e73c9.tar.gz kernel-7b5ab04f035f829ed6008e4685501ec00b3e73c9.zip | |
timekeeping: Fix resource leak in tk_aux_sysfs_init() error paths
tk_aux_sysfs_init() returns immediately on error during the auxiliary clock
initialization loop without cleaning up previously allocated kobjects and
sysfs groups.
If kobject_create_and_add() or sysfs_create_group() fails during loop
iteration, the parent kobjects (tko and auxo) and any previously created
child kobjects are leaked.
Fix this by adding proper error handling with goto labels to ensure all
allocated resources are cleaned up on failure. kobject_put() on the
parent kobjects will handle cleanup of their children.
Fixes: 7b95663a3d96 ("timekeeping: Provide interface to control auxiliary clocks")
Signed-off-by: Malaya Kumar Rout <[email protected]>
Signed-off-by: Thomas Gleixner <[email protected]>
Link: https://patch.msgid.link/[email protected]
Diffstat (limited to 'tools/lib/traceevent/plugins/plugin_function.c')
0 files changed, 0 insertions, 0 deletions
