lkml.org 
[lkml]   [2022]   [Jun]   [8]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [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]
\
 
 \ /
  Last update: 2022-06-08 23:09    [W:0.121 / U:0.048 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site