Messages in this thread | | | Date | Wed, 8 Jun 2022 23:08:30 +0200 | From | Pavel Machek <> | Subject | Re: [PATCH AUTOSEL 5.10 21/38] accessiblity: speakup: Add missing misc_deregister in softsynth_probe |
| |
Hi!
> From: Zheng Bin <zhengbin13@huawei.com> > > [ Upstream commit 106101303eda8f93c65158e5d72b2cc6088ed034 ] > > softsynth_probe misses a call misc_deregister() in an error path, this > patch fixes that.
This seems incorrect. Registration failed, we can't really deregister.
I checked random other caller of misc_register(), and it does not seem this API is unusual.
Best regards, Pavel
> +++ b/drivers/accessibility/speakup/speakup_soft.c > @@ -390,6 +390,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; > }
-- DENX Software Engineering GmbH, Managing Director: Wolfgang Denk HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany [unhandled content-type:application/pgp-signature] | |