From: Marcel Holtmann Date: Mon, 16 Oct 2006 15:59:28 +0000 (+0000) Subject: [PATCH] Bluetooth: Check if DLC is still attached to the TTY X-Git-Tag: v2.6.18.2~42 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b754f1bb053d9ec2d9b9fb64126543e9b8cbd3dd;p=thirdparty%2Fkernel%2Fstable.git [PATCH] Bluetooth: Check if DLC is still attached to the TTY [Bluetooth] Check if DLC is still attached to the TTY If the DLC device is no longer attached to the TTY device, then it makes no sense to go through with changing the termios settings. Signed-off-by: Marcel Holtmann Signed-off-by: Greg Kroah-Hartman Signed-off-by: Chris Wright --- diff --git a/net/bluetooth/rfcomm/tty.c b/net/bluetooth/rfcomm/tty.c index bd8d671a0ba6f..5d65cebda801c 100644 --- a/net/bluetooth/rfcomm/tty.c +++ b/net/bluetooth/rfcomm/tty.c @@ -748,6 +748,9 @@ static void rfcomm_tty_set_termios(struct tty_struct *tty, struct termios *old) BT_DBG("tty %p termios %p", tty, old); + if (!dev) + return; + /* Handle turning off CRTSCTS */ if ((old->c_cflag & CRTSCTS) && !(new->c_cflag & CRTSCTS)) BT_DBG("Turning off CRTSCTS unsupported");