]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
media: cec: Fix debugfs leak on bus_register() failure
authorHaotian Zhang <vulab@iscas.ac.cn>
Mon, 29 Sep 2025 11:12:29 +0000 (19:12 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 19 Jan 2026 12:11:58 +0000 (13:11 +0100)
commitdf4dcf0f72e50f25d26a30b452a6ecb1feb3e337
treea116a59a4815099a6ffdb444206de8217dad3a8c
parent5073a633ab29b4b8e08e663ef15e1efa006fbadd
media: cec: Fix debugfs leak on bus_register() failure

commit c43bcd2b2aa3c2ca9d2433c3990ecbc2c47d10eb upstream.

In cec_devnode_init(), the debugfs directory created with
debugfs_create_dir() is not removed if bus_register() fails.
This leaves a stale "cec" entry in debugfs and prevents
proper module reloading.

Fix this by removing the debugfs directory in the error path.

Fixes: a56960e8b406 ("[media] cec: add HDMI CEC framework (core)")
Cc: stable@vger.kernel.org
Signed-off-by: Haotian Zhang <vulab@iscas.ac.cn>
Signed-off-by: Hans Verkuil <hverkuil+cisco@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/media/cec/core/cec-core.c