diff options
| author | Linmao Li <lilinmao@kylinos.cn> | 2026-08-28 14:19:49 +0800 |
|---|---|---|
| committer | Guenter Roeck <linux@roeck-us.net> | 2026-09-09 18:16:35 -0700 |
| commit | 4ee875c423c66c45d7ef7bbff403cd0e3971e0a2 (patch) | |
| tree | d39ca14c96b96546d0e4fc82ad3d317c35832579 /scripts/basic/split-include.c | |
| parent | 09a9e1746a87845d7d8e2b4e23bb613306effdff (diff) | |
| download | linux-4ee875c423c66c45d7ef7bbff403cd0e3971e0a2.tar.gz linux-4ee875c423c66c45d7ef7bbff403cd0e3971e0a2.zip | |
hwmon: (corsair-cpro) Remove debugfs entries when probe fails
ccp_debugfs_init() registers debugfs files whose private data is the devm
allocated ccp. If hwmon_device_register_with_info() fails right after it,
ccp_probe() returns without removing them: the HID core then frees ccp,
and ccp_remove() is not called for a failed probe, so the files stay
behind. Reading one of them dereferences the freed pointer.
Remove the debugfs entries on that error path. debugfs_remove_recursive()
waits for readers already inside the show callbacks, so ccp is no longer
reachable through debugfs by the time probe returns.
Reported-by: Sashiko <sashiko-bot@kernel.org>
Closes: https://lore.kernel.org/linux-hwmon/20260708031612.BD7E61F000E9@smtp.kernel.org/
Fixes: 5997eb60f896 ("hwmon: (corsair-cpro) Add firmware and bootloader information")
Signed-off-by: Linmao Li <lilinmao@kylinos.cn>
Link: https://patch.msgid.link/20260828061949.3151191-1-lilinmao@kylinos.cn
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Diffstat (limited to 'scripts/basic/split-include.c')
0 files changed, 0 insertions, 0 deletions
