summaryrefslogtreecommitdiff
path: root/tools/perf/scripts/python/stackcollapse.py
diff options
context:
space:
mode:
authorSumeet Pawnikar <sumeet4linux@gmail.com>2025-12-05 22:02:16 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2026-01-17 18:30:01 +0300
commite07dea55aa13435d048ee4bc7ee2d02c4491b47e (patch)
tree0246e8872520eb0153dcdf6b452d06222aebc12a /tools/perf/scripts/python/stackcollapse.py
parent98676ee71fd4eafeb8be63c7f3f1905d40e03101 (diff)
downloadlinux-e07dea55aa13435d048ee4bc7ee2d02c4491b47e.tar.xz
powercap: fix race condition in register_control_type()
[ Upstream commit 7bda1910c4bccd4b8d4726620bb3d6bbfb62286e ] The device becomes visible to userspace via device_register() even before it fully initialized by idr_init(). If userspace or another thread tries to register a zone immediately after device_register(), the control_type_valid() will fail because the control_type is not yet in the list. The IDR is not yet initialized, so this race condition causes zone registration failure. Move idr_init() and list addition before device_register() fix the race condition. Signed-off-by: Sumeet Pawnikar <sumeet4linux@gmail.com> [ rjw: Subject adjustment, empty line added ] Link: https://patch.msgid.link/20251205190216.5032-1-sumeet4linux@gmail.com Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com> Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'tools/perf/scripts/python/stackcollapse.py')
0 files changed, 0 insertions, 0 deletions