From 408795b0252fe3b060c3c62b630f5419db415adf Mon Sep 17 00:00:00 2001 From: Xiaofei Tan Date: Wed, 7 Apr 2021 15:06:49 +0800 Subject: [PATCH] tty: tty_ldisc: Do not use assignment in if condition Do not use assignment in if condition following the advice of checkpatch.pl. Signed-off-by: Xiaofei Tan Link: https://lore.kernel.org/r/1617779210-51576-10-git-send-email-tanxiaofei@huawei.com Signed-off-by: Greg Kroah-Hartman --- drivers/tty/tty_ldisc.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/tty/tty_ldisc.c b/drivers/tty/tty_ldisc.c index 874d238..56e67f7 100644 --- a/drivers/tty/tty_ldisc.c +++ b/drivers/tty/tty_ldisc.c @@ -508,7 +508,8 @@ static int tty_ldisc_failto(struct tty_struct *tty, int ld) return PTR_ERR(disc); tty->ldisc = disc; tty_set_termios_ldisc(tty, ld); - if ((r = tty_ldisc_open(tty, disc)) < 0) + r = tty_ldisc_open(tty, disc); + if (r < 0) tty_ldisc_put(disc); return r; } -- 2.7.4