mirror of
https://github.com/torvalds/linux.git
synced 2026-01-25 07:47:50 +00:00
refperf: Set reader_tasks to NULL after kfree()
Set reader_tasks to NULL after kfree() in ref_scale_cleanup() to improve debugging experience with kernel debugging tools. This follows the common pattern of NULLing pointers after freeing to avoid dangling pointer issues during debugging sessions. Setting pointers to NULL after freeing helps debugging tools like kdgb,drgn, and other kernel debuggers by providing clear indication that the memory has been freed and the pointer is no longer valid. Suggested-by: Paul E. McKenney <paulmck@kernel.org> Signed-off-by: Kaushlendra Kumar <kaushlendra.kumar@intel.com> Signed-off-by: Paul E. McKenney <paulmck@kernel.org>
This commit is contained in:
committed by
Paul E. McKenney
parent
fb7855a6b5
commit
1441edd129
@@ -1133,6 +1133,7 @@ ref_scale_cleanup(void)
|
||||
reader_tasks[i].task);
|
||||
}
|
||||
kfree(reader_tasks);
|
||||
reader_tasks = NULL;
|
||||
|
||||
torture_stop_kthread("main_task", main_task);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user