accessiblity: speakup: Add missing misc_deregister in softsynth_probe
authorZheng Bin <zhengbin13@huawei.com>
Wed, 11 May 2022 03:29:37 +0000 (11:29 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 19 May 2022 16:56:48 +0000 (18:56 +0200)
softsynth_probe misses a call misc_deregister() in an error path, this
patch fixes that.

Signed-off-by: Zheng Bin <zhengbin13@huawei.com>
Link: https://lore.kernel.org/r/20220511032937.2736738-1-zhengbin13@huawei.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/accessibility/speakup/speakup_soft.c

index 1ced2721513e1d2320545ce501828f9bf3d0f414..99f1d4ac426a44d37be27a4359ae58ce74e5b275 100644 (file)
@@ -397,6 +397,7 @@ static int softsynth_probe(struct spk_synth *synth)
        synthu_device.name = "softsynthu";
        synthu_device.fops = &softsynthu_fops;
        if (misc_register(&synthu_device)) {
+               misc_deregister(&synth_device);
                pr_warn("Couldn't initialize miscdevice /dev/softsynthu.\n");
                return -ENODEV;
        }