linux-serial.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2 1/9] Bluetooth: hci_uart_set_flow_control: Fix NULL deref when using serdev
@ 2017-10-04 18:43 Hans de Goede
  2017-10-04 18:43 ` [PATCH v2 2/9] Bluetooth: hci_bcm: Fix setting of irq trigger type Hans de Goede
                   ` (8 more replies)
  0 siblings, 9 replies; 21+ messages in thread
From: Hans de Goede @ 2017-10-04 18:43 UTC (permalink / raw)
  To: Marcel Holtmann, Gustavo Padovan, Johan Hedberg
  Cc: Hans de Goede, Frédéric Danis, Sebastian Reichel, robh,
	linux-bluetooth, linux-serial, linux-acpi

Fix a NULL pointer deref (hu->tty) when calling hci_uart_set_flow_control
on hci_uart-s using serdev.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
---
Changes in v2:
-Also set RTS (Suggested-by: Sebastian Reichel <sre@kernel.org>)
---
 drivers/bluetooth/hci_ldisc.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/drivers/bluetooth/hci_ldisc.c b/drivers/bluetooth/hci_ldisc.c
index a746627e784e..eec95019f15c 100644
--- a/drivers/bluetooth/hci_ldisc.c
+++ b/drivers/bluetooth/hci_ldisc.c
@@ -41,6 +41,7 @@
 #include <linux/ioctl.h>
 #include <linux/skbuff.h>
 #include <linux/firmware.h>
+#include <linux/serdev.h>
 
 #include <net/bluetooth/bluetooth.h>
 #include <net/bluetooth/hci_core.h>
@@ -298,6 +299,12 @@ void hci_uart_set_flow_control(struct hci_uart *hu, bool enable)
 	unsigned int set = 0;
 	unsigned int clear = 0;
 
+	if (hu->serdev) {
+		serdev_device_set_flow_control(hu->serdev, !enable);
+		serdev_device_set_rts(hu->serdev, !enable);
+		return;
+	}
+
 	if (enable) {
 		/* Disable hardware flow control */
 		ktermios = tty->termios;
-- 
2.14.2


^ permalink raw reply related	[flat|nested] 21+ messages in thread

end of thread, other threads:[~2017-10-09 18:01 UTC | newest]

Thread overview: 21+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-10-04 18:43 [PATCH v2 1/9] Bluetooth: hci_uart_set_flow_control: Fix NULL deref when using serdev Hans de Goede
2017-10-04 18:43 ` [PATCH v2 2/9] Bluetooth: hci_bcm: Fix setting of irq trigger type Hans de Goede
2017-10-04 18:43 ` [PATCH v2 3/9] Bluetooth: hci_bcm: Move bcm_platform_probe call out of bcm_acpi_probe Hans de Goede
2017-10-04 18:43 ` [PATCH v2 4/9] Bluetooth: hci_bcm: Move platform_get_irq call to bcm_probe Hans de Goede
2017-10-04 18:43 ` [PATCH v2 5/9] Bluetooth: hci_bcm: Store device pointer instead of platform_device pointer Hans de Goede
2017-10-04 18:43 ` [PATCH v2 6/9] Bluetooth: hci_bcm: Rename bcm_platform_probe to bcm_get_resources Hans de Goede
2017-10-04 18:43 ` [PATCH v2 7/9] Bluetooth: hci_bcm: Make acpi_probe get irq from ACPI resources Hans de Goede
2017-10-04 18:43 ` [PATCH v2 8/9] Bluetooth: hci_bcm: Make suspend/resume functions platform_dev independent Hans de Goede
     [not found] ` <20171004184343.7855-1-hdegoede-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2017-10-04 18:43   ` [PATCH v2 9/9] Bluetooth: hci_bcm: Add (runtime)pm support to the serdev driver Hans de Goede
     [not found]     ` <20171004184343.7855-9-hdegoede-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2017-10-05 10:45       ` Marcel Holtmann
     [not found]         ` <DFCF661F-6FE0-4449-A169-D71ED9282074-kz+m5ild9QBg9hUCZPvPmw@public.gmane.org>
2017-10-05 11:18           ` Hans de Goede
2017-10-05 15:15             ` Marcel Holtmann
     [not found]               ` <17592E57-3A4B-4386-B809-9EA928D38FDD-kz+m5ild9QBg9hUCZPvPmw@public.gmane.org>
2017-10-05 17:53                 ` Hans de Goede
2017-10-06 18:33                   ` Marcel Holtmann
2017-10-07 14:26               ` Johan Hovold
2017-10-09 14:02                 ` Hans de Goede
2017-10-09 14:22                   ` Johan Hovold
2017-10-07 14:36 ` [PATCH v2 1/9] Bluetooth: hci_uart_set_flow_control: Fix NULL deref when using serdev Johan Hovold
2017-10-09 14:06   ` Hans de Goede
2017-10-09 15:15     ` Johan Hovold
2017-10-09 18:01     ` Marcel Holtmann

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).