diff options
| author | 2025-12-06 00:32:16 +0530 | |
|---|---|---|
| committer | 2025-12-15 12:29:11 +0100 | |
| commit | 7bda1910c4bccd4b8d4726620bb3d6bbfb62286e (patch) | |
| tree | e084db4e2270398ab0f0a3385aba53212dcfa0d8 /tools/docs/ssh:/git@git.zx2c4.com | |
| parent | Linux 6.19-rc1 (diff) | |
powercap: fix race condition in register_control_type()
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>
Diffstat (limited to 'tools/docs/ssh:/git@git.zx2c4.com')
0 files changed, 0 insertions, 0 deletions
