All of lore.kernel.org
 help / color / mirror / Atom feed
From: Zheng Bin <zhengbin13@huawei.com>
To: <gregkh@linuxfoundation.org>, <salah.triki@gmail.com>,
	<trix@redhat.com>, <speakup@linux-speakup.org>,
	<linux-kernel@vger.kernel.org>
Cc: <zhengbin13@huawei.com>, <gaochao49@huawei.com>
Subject: [PATCH -next] accessiblity: speakup: Add missing misc_deregister in softsynth_probe
Date: Wed, 11 May 2022 11:29:37 +0800	[thread overview]
Message-ID: <20220511032937.2736738-1-zhengbin13@huawei.com> (raw)

softsynth_probe misses a call misc_deregister() in an error path, this
patch fixes that.

Signed-off-by: Zheng Bin <zhengbin13@huawei.com>
---
 drivers/accessibility/speakup/speakup_soft.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/accessibility/speakup/speakup_soft.c b/drivers/accessibility/speakup/speakup_soft.c
index 1ced2721513e..99f1d4ac426a 100644
--- a/drivers/accessibility/speakup/speakup_soft.c
+++ b/drivers/accessibility/speakup/speakup_soft.c
@@ -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;
 	}
--
2.31.1


                 reply	other threads:[~2022-05-11  3:16 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220511032937.2736738-1-zhengbin13@huawei.com \
    --to=zhengbin13@huawei.com \
    --cc=gaochao49@huawei.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=salah.triki@gmail.com \
    --cc=speakup@linux-speakup.org \
    --cc=trix@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.