]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
regmap: debugfs: fix race condition in dummy name allocation
authorZxyan Zhu <zxyan0222@gmail.com>
Thu, 9 Apr 2026 03:50:15 +0000 (11:50 +0800)
committerMark Brown <broonie@kernel.org>
Thu, 9 Apr 2026 19:50:54 +0000 (20:50 +0100)
commit7d696210cf36ed31c7c37f6eff17cb7147e83367
tree2cec19e062225555b9aa3a6756a81fe1687a004b
parent1ef3e1c278eb7bda1cc09a508c3fe65d2e567c77
regmap: debugfs: fix race condition in dummy name allocation

Use IDA instead of a simple counter for generating unique dummy names.
The previous implementation used dummy_index++ which is not atomic,
leading to potential duplicate names when multiple threads call
regmap_debugfs_init() concurrently with name="dummy".

Signed-off-by: Zxyan Zhu <zxyan0222@gmail.com>
Link: https://patch.msgid.link/20260409035015.950764-1-zxyan0222@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
drivers/base/regmap/internal.h
drivers/base/regmap/regmap-debugfs.c