Skip to contentSkip to conversation

Patch "Bluetooth: hci_uart_set_flow_control: Fix NULL deref when using serdev" has been added to the 4.14-stable tree

PATCH [email protected] 1 participant 1 message Dec 20, 2017

Subsystems (2)
lore
Share & tools
lore

[email protected]

author maintainer Applied
#0 lore raw

This is a note to let you know that I've just added the patch titled

Bluetooth: hci_uart_set_flow_control: Fix NULL deref when using serdev

to the 4.14-stable tree which can be found at:
http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
bluetooth-hci_uart_set_flow_control-fix-null-deref-when-using-serdev.patch
and it can be found in the queue-4.14 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree, please let <[email protected]> know about it.

Quoted 1 line

From foo@baz Wed Dec 20 18:17:52 CET 2017

From: Hans de Goede <[email protected]>
Date: Wed, 4 Oct 2017 20:43:35 +0200
Subject: Bluetooth: hci_uart_set_flow_control: Fix NULL deref when using serdev

From: Hans de Goede <[email protected]>

[ Upstream commit 7841d554809b518a22349e7e39b6b63f8a48d0fb ]

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

---
 drivers/bluetooth/hci_ldisc.c |    7 +++++++
 1 file changed, 7 insertions(+)
drivers/bluetooth/hci_ldisc.c +7 -0
@@ -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 hc
 	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;

Patches currently in stable-queue which might be from [email protected] are

queue-4.14/bluetooth-hci_uart_set_flow_control-fix-null-deref-when-using-serdev.patch queue-4.14/bluetooth-hci_bcm-fix-setting-of-irq-trigger-type.patch