public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Johan Hovold <jhovold@gmail.com>
To: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Jiri Slaby <jslaby@suse.cz>,
	Peter Hurley <peter@hurleysoftware.com>,
	"David S. Miller" <davem@davemloft.net>,
	linux-serial@vger.kernel.org, linux-kernel@vger.kernel.org,
	Johan Hovold <jhovold@gmail.com>
Subject: [PATCH 4/4] TTY: ircomm: fix DTR being raised on hang up
Date: Fri, 12 Apr 2013 10:32:31 +0200	[thread overview]
Message-ID: <1365755551-17824-5-git-send-email-jhovold@gmail.com> (raw)
In-Reply-To: <1365755551-17824-1-git-send-email-jhovold@gmail.com>

Make sure to check ASYNC_INITIALISED before raising DTR when waking up
from blocked open in ircomm_tty_block_til_ready.

Currently DTR could get raised at hang up as a blocked process would
raise DTR unconditionally before checking for hang up and returning.

Cc: David S. Miller <davem@davemloft.net>
Signed-off-by: Johan Hovold <jhovold@gmail.com>
---
 net/irda/ircomm/ircomm_tty.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/net/irda/ircomm/ircomm_tty.c b/net/irda/ircomm/ircomm_tty.c
index 362ba47..41ac7938 100644
--- a/net/irda/ircomm/ircomm_tty.c
+++ b/net/irda/ircomm/ircomm_tty.c
@@ -328,7 +328,7 @@ static int ircomm_tty_block_til_ready(struct ircomm_tty_cb *self,
 	spin_unlock_irqrestore(&port->lock, flags);
 
 	while (1) {
-		if (tty->termios.c_cflag & CBAUD)
+		if (C_BAUD(tty) && test_bit(ASYNCB_INITIALIZED, &port->flags))
 			tty_port_raise_dtr_rts(port);
 
 		set_current_state(TASK_INTERRUPTIBLE);
-- 
1.8.1.5


  parent reply	other threads:[~2013-04-12  8:34 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-04-12  8:32 [PATCH 0/4] TTY: fix DTR being raised on hang up Johan Hovold
2013-04-12  8:32 ` [PATCH 1/4] TTY: synclink: " Johan Hovold
2013-04-12  8:32 ` [PATCH 2/4] TTY: synclink_gt: " Johan Hovold
2013-04-12  8:32 ` [PATCH 3/4] TTY: synclinkmp: " Johan Hovold
2013-04-12  8:32 ` Johan Hovold [this message]
2013-04-12 17:23   ` [PATCH 4/4] TTY: ircomm: " David Miller
2013-04-15 15:11 ` [PATCH 0/4] TTY: " Peter Hurley

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1365755551-17824-5-git-send-email-jhovold@gmail.com \
    --to=jhovold@gmail.com \
    --cc=davem@davemloft.net \
    --cc=gregkh@linuxfoundation.org \
    --cc=jslaby@suse.cz \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-serial@vger.kernel.org \
    --cc=peter@hurleysoftware.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox