From 72fdb403008c598dca535cfe8ade25eb2253c1d2 Mon Sep 17 00:00:00 2001 From: Jiri Slaby Date: Fri, 23 Jul 2021 09:43:17 +0200 Subject: tty: pdc_cons, free tty_driver upon failure 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. Cc: "James E.J. Bottomley" Cc: Helge Deller Cc: linux-parisc@vger.kernel.org Signed-off-by: Jiri Slaby Link: https://lore.kernel.org/r/20210723074317.32690-9-jslaby@suse.cz Signed-off-by: Greg Kroah-Hartman --- arch/parisc/kernel/pdc_cons.c | 1 + 1 file changed, 1 insertion(+) (limited to 'arch/parisc') 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; } -- cgit v1.2.3