* [PATCH 8/8] tty: pdc_cons, free tty_driver upon failure
[not found] <20210723074317.32690-1-jslaby@suse.cz>
@ 2021-07-23 7:43 ` Jiri Slaby
0 siblings, 0 replies; only message in thread
From: Jiri Slaby @ 2021-07-23 7:43 UTC (permalink / raw)
To: gregkh
Cc: linux-serial, linux-kernel, Jiri Slaby, James E.J. Bottomley,
Helge Deller, linux-parisc
pdc_console_tty_driver_init() does not free the allocated tty driver in
case tty_register_driver() fails. Add one tty_driver_kref_put() to the
error path.
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
Cc: "James E.J. Bottomley" <James.Bottomley@HansenPartnership.com>
Cc: Helge Deller <deller@gmx.de>
Cc: linux-parisc@vger.kernel.org
---
arch/parisc/kernel/pdc_cons.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/arch/parisc/kernel/pdc_cons.c b/arch/parisc/kernel/pdc_cons.c
index 70c2a1648fc1..2661cdd256ae 100644
--- a/arch/parisc/kernel/pdc_cons.c
+++ b/arch/parisc/kernel/pdc_cons.c
@@ -181,6 +181,7 @@ static int __init pdc_console_tty_driver_init(void)
if (err) {
printk(KERN_ERR "Unable to register the PDC console TTY driver\n");
tty_port_destroy(&tty_port);
+ tty_driver_kref_put(driver);
return err;
}
--
2.32.0
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2021-07-23 7:43 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
[not found] <20210723074317.32690-1-jslaby@suse.cz>
2021-07-23 7:43 ` [PATCH 8/8] tty: pdc_cons, free tty_driver upon failure Jiri Slaby
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).