diff options
Diffstat (limited to 'net/bluetooth/rfcomm/tty.c')
| -rw-r--r-- | net/bluetooth/rfcomm/tty.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/net/bluetooth/rfcomm/tty.c b/net/bluetooth/rfcomm/tty.c index 1958ad1b8541..1fb5d42f37ae 100644 --- a/net/bluetooth/rfcomm/tty.c +++ b/net/bluetooth/rfcomm/tty.c | |||
| @@ -172,12 +172,10 @@ static struct device *rfcomm_get_device(struct rfcomm_dev *dev) | |||
| 172 | return NULL; | 172 | return NULL; |
| 173 | 173 | ||
| 174 | conn = hci_conn_hash_lookup_ba(hdev, ACL_LINK, &dev->dst); | 174 | conn = hci_conn_hash_lookup_ba(hdev, ACL_LINK, &dev->dst); |
| 175 | if (!conn) | ||
| 176 | return NULL; | ||
| 177 | 175 | ||
| 178 | hci_dev_put(hdev); | 176 | hci_dev_put(hdev); |
| 179 | 177 | ||
| 180 | return &conn->dev; | 178 | return conn ? &conn->dev : NULL; |
| 181 | } | 179 | } |
| 182 | 180 | ||
| 183 | static int rfcomm_dev_add(struct rfcomm_dev_req *req, struct rfcomm_dlc *dlc) | 181 | static int rfcomm_dev_add(struct rfcomm_dev_req *req, struct rfcomm_dlc *dlc) |
| @@ -767,6 +765,9 @@ static void rfcomm_tty_set_termios(struct tty_struct *tty, struct termios *old) | |||
| 767 | 765 | ||
| 768 | BT_DBG("tty %p termios %p", tty, old); | 766 | BT_DBG("tty %p termios %p", tty, old); |
| 769 | 767 | ||
| 768 | if (!dev || !dev->dlc || !dev->dlc->session) | ||
| 769 | return; | ||
| 770 | |||
| 770 | /* Handle turning off CRTSCTS */ | 771 | /* Handle turning off CRTSCTS */ |
| 771 | if ((old->c_cflag & CRTSCTS) && !(new->c_cflag & CRTSCTS)) | 772 | if ((old->c_cflag & CRTSCTS) && !(new->c_cflag & CRTSCTS)) |
| 772 | BT_DBG("Turning off CRTSCTS unsupported"); | 773 | BT_DBG("Turning off CRTSCTS unsupported"); |
