Skip to content

Commit

Permalink
tty: pdc_cons, free tty_driver upon failure
Browse files Browse the repository at this point in the history
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" <James.Bottomley@HansenPartnership.com>
Cc: Helge Deller <deller@gmx.de>
Cc: linux-parisc@vger.kernel.org
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
Link: https://lore.kernel.org/r/20210723074317.32690-9-jslaby@suse.cz
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
  • Loading branch information
Jiri Slaby authored and Greg Kroah-Hartman committed Jul 27, 2021
1 parent 9f90a4d commit 72fdb40
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions arch/parisc/kernel/pdc_cons.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down

0 comments on commit 72fdb40

Please sign in to comment.