mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-06-20 13:41:30 +00:00
tty: Fix ldisc leak in failed tty_init_dev()
release_tty() leaks the ldisc instance when called directly (rather than when releasing the file descriptor from tty_release()). Since tty_ldisc_release() clears tty->ldisc, releasing the ldisc instance at tty teardown if tty->ldisc is non-null is not in danger of double-releasing the ldisc. Remove deinitialize_tty_struct() now that free_tty_struct() always performs the tty_ldisc_deinit(). Signed-off-by: Peter Hurley <peter@hurleysoftware.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
f4f9edcf9b
commit
c8b710b3e4
4 changed files with 8 additions and 23 deletions
|
@ -509,7 +509,6 @@ extern int tty_alloc_file(struct file *file);
|
|||
extern void tty_add_file(struct tty_struct *tty, struct file *file);
|
||||
extern void tty_free_file(struct file *file);
|
||||
extern void free_tty_struct(struct tty_struct *tty);
|
||||
extern void deinitialize_tty_struct(struct tty_struct *tty);
|
||||
extern struct tty_struct *tty_init_dev(struct tty_driver *driver, int idx);
|
||||
extern int tty_release(struct inode *inode, struct file *filp);
|
||||
extern int tty_init_termios(struct tty_struct *tty);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue