Skip to content

Commit fa91418

Browse files
committed
Merge tag 'tty-5.6-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty
Pull tty fixes from Greg KH: "Here are three small tty_io bugfixes for reported issues that Eric has resolved for 5.6-rc7 All of these have been in linux-next with no reported issues" * tag 'tty-5.6-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty: tty: fix compat TIOCGSERIAL checking wrong function ptr tty: fix compat TIOCGSERIAL leaking uninitialized memory tty: drop outdated comments about release_tty() locking
2 parents 12bf19c + 6e622cd commit fa91418

File tree

1 file changed

+6
-8
lines changed

1 file changed

+6
-8
lines changed

drivers/tty/tty_io.c

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1589,9 +1589,7 @@ void tty_kclose(struct tty_struct *tty)
15891589
tty_debug_hangup(tty, "freeing structure\n");
15901590
/*
15911591
* The release_tty function takes care of the details of clearing
1592-
* the slots and preserving the termios structure. The tty_unlock_pair
1593-
* should be safe as we keep a kref while the tty is locked (so the
1594-
* unlock never unlocks a freed tty).
1592+
* the slots and preserving the termios structure.
15951593
*/
15961594
mutex_lock(&tty_mutex);
15971595
tty_port_set_kopened(tty->port, 0);
@@ -1621,9 +1619,7 @@ void tty_release_struct(struct tty_struct *tty, int idx)
16211619
tty_debug_hangup(tty, "freeing structure\n");
16221620
/*
16231621
* The release_tty function takes care of the details of clearing
1624-
* the slots and preserving the termios structure. The tty_unlock_pair
1625-
* should be safe as we keep a kref while the tty is locked (so the
1626-
* unlock never unlocks a freed tty).
1622+
* the slots and preserving the termios structure.
16271623
*/
16281624
mutex_lock(&tty_mutex);
16291625
release_tty(tty, idx);
@@ -2734,9 +2730,11 @@ static int compat_tty_tiocgserial(struct tty_struct *tty,
27342730
struct serial_struct32 v32;
27352731
struct serial_struct v;
27362732
int err;
2737-
memset(&v, 0, sizeof(struct serial_struct));
27382733

2739-
if (!tty->ops->set_serial)
2734+
memset(&v, 0, sizeof(v));
2735+
memset(&v32, 0, sizeof(v32));
2736+
2737+
if (!tty->ops->get_serial)
27402738
return -ENOTTY;
27412739
err = tty->ops->get_serial(tty, &v);
27422740
if (!err) {

0 commit comments

Comments
 (0)