From: Zheng Bin <zhengbin13@huawei.com>
To: <gregkh@linuxfoundation.org>, <jirislaby@kernel.org>,
<linux-serial@vger.kernel.org>, <linux-kernel@vger.kernel.org>
Cc: <zhengbin13@huawei.com>, <gaochao49@huawei.com>
Subject: [PATCH -next] tty: serial: max3100: Add missing uart_unregister_driver in max3100_probe
Date: Wed, 11 May 2022 15:15:23 +0800 [thread overview]
Message-ID: <20220511071523.3128725-1-zhengbin13@huawei.com> (raw)
max3100_probe misses a call uart_unregister_driver in error path,
this patch fixes that.
Signed-off-by: Zheng Bin <zhengbin13@huawei.com>
---
drivers/tty/serial/max3100.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/drivers/tty/serial/max3100.c b/drivers/tty/serial/max3100.c
index 0b5f21fbb53d..6d34ca2a3f7b 100644
--- a/drivers/tty/serial/max3100.c
+++ b/drivers/tty/serial/max3100.c
@@ -752,6 +752,7 @@ static int max3100_probe(struct spi_device *spi)
if (!max3100s[i])
break;
if (i == MAX_MAX3100) {
+ uart_unregister_driver(&max3100_uart_driver);
dev_warn(&spi->dev, "too many MAX3100 chips\n");
mutex_unlock(&max3100s_lock);
return -ENOMEM;
@@ -759,6 +760,7 @@ static int max3100_probe(struct spi_device *spi)
max3100s[i] = kzalloc(sizeof(struct max3100_port), GFP_KERNEL);
if (!max3100s[i]) {
+ uart_unregister_driver(&max3100_uart_driver);
dev_warn(&spi->dev,
"kmalloc for max3100 structure %d failed!\n", i);
mutex_unlock(&max3100s_lock);
--
2.31.1
next reply other threads:[~2022-05-11 7:01 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-05-11 7:15 Zheng Bin [this message]
2022-05-11 9:38 ` [PATCH -next] tty: serial: max3100: Add missing uart_unregister_driver in max3100_probe Jiri Slaby
2022-05-17 10:17 ` Greg KH
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=20220511071523.3128725-1-zhengbin13@huawei.com \
--to=zhengbin13@huawei.com \
--cc=gaochao49@huawei.com \
--cc=gregkh@linuxfoundation.org \
--cc=jirislaby@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-serial@vger.kernel.org \
/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.