On Mon Sep 29 19:12:29 2025 +0800, Haotian Zhang wrote:
> 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: [email protected]
> Signed-off-by: Haotian Zhang <[email protected]>
> Signed-off-by: Hans Verkuil <[email protected]>

Patch committed.

Thanks,
Hans Verkuil

 drivers/media/cec/core/cec-core.c | 1 +
 1 file changed, 1 insertion(+)

---

diff --git a/drivers/media/cec/core/cec-core.c 
b/drivers/media/cec/core/cec-core.c
index d7259599029f..dd6e24a0899b 100644
--- a/drivers/media/cec/core/cec-core.c
+++ b/drivers/media/cec/core/cec-core.c
@@ -421,6 +421,7 @@ static int __init cec_devnode_init(void)
 
        ret = bus_register(&cec_bus_type);
        if (ret < 0) {
+               debugfs_remove_recursive(top_cec_dir);
                unregister_chrdev_region(cec_dev_t, CEC_NUM_DEVICES);
                pr_warn("cec: bus_register failed\n");
                return -EIO;
_______________________________________________
linuxtv-commits mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to