Skip to content

Commit 6e622cd

Browse files
ebiggersgregkh
authored andcommitted
tty: fix compat TIOCGSERIAL checking wrong function ptr
Commit 7765435 ("take compat TIOC[SG]SERIAL treatment into tty_compat_ioctl()") changed the compat version of TIOCGSERIAL to start checking for the presence of the ->set_serial function pointer rather than ->get_serial. This appears to be a copy-and-paste error, since ->get_serial is the function pointer that is called as well as the pointer that is checked by the non-compat version of TIOCGSERIAL. Fix this by checking the correct function pointer. Fixes: 7765435 ("take compat TIOC[SG]SERIAL treatment into tty_compat_ioctl()") Cc: <[email protected]> # v4.20+ Signed-off-by: Eric Biggers <[email protected]> Acked-by: Jiri Slaby <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent 1732956 commit 6e622cd

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/tty/tty_io.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2734,7 +2734,7 @@ static int compat_tty_tiocgserial(struct tty_struct *tty,
27342734
memset(&v, 0, sizeof(v));
27352735
memset(&v32, 0, sizeof(v32));
27362736

2737-
if (!tty->ops->set_serial)
2737+
if (!tty->ops->get_serial)
27382738
return -ENOTTY;
27392739
err = tty->ops->get_serial(tty, &v);
27402740
if (!err) {

0 commit comments

Comments
 (0)