]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
media: siano: Fix error handling in smsdvb_module_init()
authorYuan Can <yuancan@huawei.com>
Tue, 22 Oct 2024 06:50:37 +0000 (14:50 +0800)
committerHans Verkuil <hverkuil@xs4all.nl>
Thu, 6 Mar 2025 16:28:29 +0000 (17:28 +0100)
The smsdvb_module_init() returns without checking the retval from
smscore_register_hotplug().
If the smscore_register_hotplug() failed, the module failed to install,
leaving the smsdvb_debugfs not unregistered.

Fixes: 3f6b87cff66b ("[media] siano: allow showing the complete statistics via debugfs")
Cc: stable@vger.kernel.org
Signed-off-by: Yuan Can <yuancan@huawei.com>
Acked-by: Ricardo Ribalda <ribalda@chromium.org>
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
drivers/media/common/siano/smsdvb-main.c

index 44d8fe8b220e79af5abb274692221c1174993735..9b1a650ed055c9856f50e94a731522aa83235ecb 100644 (file)
@@ -1243,6 +1243,8 @@ static int __init smsdvb_module_init(void)
        smsdvb_debugfs_register();
 
        rc = smscore_register_hotplug(smsdvb_hotplug);
+       if (rc)
+               smsdvb_debugfs_unregister();
 
        pr_debug("\n");