]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
refperf: Remove redundant kfree() after torture_stop_kthread()
authorKaushlendra Kumar <kaushlendra.kumar@intel.com>
Wed, 10 Sep 2025 15:14:19 +0000 (20:44 +0530)
committerPaul E. McKenney <paulmck@kernel.org>
Mon, 15 Sep 2025 12:20:09 +0000 (05:20 -0700)
Remove unnecessary kfree(main_task) call in ref_scale_cleanup() as
torture_stop_kthread() already handles the memory cleanup for the
task structure internally.

The additional kfree(main_task) call after torture_stop_kthread()
is redundant and confusing since torture_stop_kthread() sets the
pointer to NULL, making this a no-op.

This pattern is consistent with other torture test modules where
torture_stop_kthread() is called without explicit kfree() of the
task pointer, as the torture framework manages the task lifecycle
internally.

Signed-off-by: Kaushlendra Kumar <kaushlendra.kumar@intel.com>
Signed-off-by: Paul E. McKenney <paulmck@kernel.org>
kernel/rcu/refscale.c

index 5840fac06feb7d4930f530629ca9ade9730768dd..7f3d23762ef7c7fb010d0da70153f4fe2e2cb161 100644 (file)
@@ -1135,7 +1135,6 @@ ref_scale_cleanup(void)
        kfree(reader_tasks);
 
        torture_stop_kthread("main_task", main_task);
-       kfree(main_task);
 
        // Do scale-type-specific cleanup operations.
        if (cur_ops->cleanup != NULL)