linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Myungho Jung <mhjungk@gmail.com>
To: marcel@holtmann.org
Cc: johan.hedberg@gmail.com, linux-bluetooth@vger.kernel.org,
	linux-kernel@vger.kernel.org, Myungho Jung <mhjungk@gmail.com>,
	stable@vger.kernel.org
Subject: [PATCH v3 2/2] Bluetooth: hci_ldisc: Add NULL check for tiocmget() and tiocmset() in hci_uart_set_flow_control()
Date: Mon,  4 Feb 2019 22:41:42 -0800	[thread overview]
Message-ID: <4cc3a826614822661dbedad74d9970172cbfa6d7.1549346039.git.mhjungk@gmail.com> (raw)
In-Reply-To: <cover.1549346039.git.mhjungk@gmail.com>
In-Reply-To: <cover.1549346039.git.mhjungk@gmail.com>

tiocmget() or tiocmset() operations are optional. Just return from
hci_uart_set_flow_control() if tiocmget() or tiocmset() operation is
NULL.

Fixes: 2a973dfada2b ("hci_uart: Add new line discipline enhancements")
Cc: <stable@vger.kernel.org> # 4.2
Signed-off-by: Myungho Jung <mhjungk@gmail.com>
---
Changes in v2:
  - Remove braces in if statment

Changes in v3:
  - Split into 2 patches
  - Add stable CC and fixes tags

 drivers/bluetooth/hci_ldisc.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/drivers/bluetooth/hci_ldisc.c b/drivers/bluetooth/hci_ldisc.c
index fbf7b4df23ab..cb31c2d8d826 100644
--- a/drivers/bluetooth/hci_ldisc.c
+++ b/drivers/bluetooth/hci_ldisc.c
@@ -314,6 +314,10 @@ void hci_uart_set_flow_control(struct hci_uart *hu, bool enable)
 		return;
 	}
 
+	/* tiocmget() and tiocmset() operations are optional */
+	if (!tty->driver->ops->tiocmget || !tty->driver->ops->tiocmset)
+		return;
+
 	if (enable) {
 		/* Disable hardware flow control */
 		ktermios = tty->termios;
-- 
2.17.1


  parent reply	other threads:[~2019-02-05  6:43 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-02-05  6:41 [PATCH v3 0/2] Bluetooth: Add NULL check for tiocmget() and tiocmset() Myungho Jung
2019-02-05  6:41 ` [PATCH v3 1/2] Bluetooth: hci_ath: Add NULL check for tiocmget() and tiocmset() in ath_setup() Myungho Jung
2019-02-05  6:41 ` Myungho Jung [this message]
2019-07-06 10:49   ` [PATCH v3 2/2] Bluetooth: hci_ldisc: Add NULL check for tiocmget() and tiocmset() in hci_uart_set_flow_control() Marcel Holtmann
2019-02-05 13:55 ` [PATCH v3 0/2] Bluetooth: Add NULL check for tiocmget() and tiocmset() Marcel Holtmann
2019-02-06  6:35   ` Myungho Jung
2019-02-06  7:06     ` Marcel Holtmann
2019-02-07 17:34       ` Myungho Jung

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=4cc3a826614822661dbedad74d9970172cbfa6d7.1549346039.git.mhjungk@gmail.com \
    --to=mhjungk@gmail.com \
    --cc=johan.hedberg@gmail.com \
    --cc=linux-bluetooth@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=marcel@holtmann.org \
    --cc=stable@vger.kernel.org \
    /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;
as well as URLs for NNTP newsgroup(s).