Skip to content

Commit 2433f05

Browse files
Jiri Slaby (SUSE)gregkh
Jiri Slaby (SUSE)
authored andcommitted
tty: use 'if' in send_break() instead of 'goto'
[ Upstream commit 24f2cd0 ] Now, the "jumped-over" code is simple enough to be put inside an 'if'. Do so to make it 'goto'-less. Signed-off-by: "Jiri Slaby (SUSE)" <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]> Stable-dep-of: 66aad7d ("usb: cdc-acm: return correct error code on unsupported break") Signed-off-by: Sasha Levin <[email protected]>
1 parent eefdb1b commit 2433f05

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

drivers/tty/tty_io.c

+4-5
Original file line numberDiff line numberDiff line change
@@ -2482,11 +2482,10 @@ static int send_break(struct tty_struct *tty, unsigned int duration)
24822482
return -EINTR;
24832483

24842484
retval = tty->ops->break_ctl(tty, -1);
2485-
if (retval)
2486-
goto out;
2487-
msleep_interruptible(duration);
2488-
retval = tty->ops->break_ctl(tty, 0);
2489-
out:
2485+
if (!retval) {
2486+
msleep_interruptible(duration);
2487+
retval = tty->ops->break_ctl(tty, 0);
2488+
}
24902489
tty_write_unlock(tty);
24912490

24922491
if (signal_pending(current))

0 commit comments

Comments
 (0)