From: Sebastian Reichel <sre@kernel.org>
To: Hans de Goede <hdegoede@redhat.com>
Cc: "Marcel Holtmann" <marcel@holtmann.org>,
"Gustavo Padovan" <gustavo@padovan.org>,
"Johan Hedberg" <johan.hedberg@gmail.com>,
"Frédéric Danis" <frederic.danis.oss@gmail.com>,
robh@kernel.org, linux-bluetooth@vger.kernel.org,
linux-serial@vger.kernel.org, linux-acpi@vger.kernel.org
Subject: Re: [PATCH 1/9] Bluetooth: hci_uart_set_flow_control: Fix NULL deref when using serdev
Date: Tue, 3 Oct 2017 00:34:15 +0200 [thread overview]
Message-ID: <20171002223415.jmbi4zw7edyuxccl@earth> (raw)
In-Reply-To: <20171002152356.4714-2-hdegoede@redhat.com>
[-- Attachment #1: Type: text/plain, Size: 1279 bytes --]
Hi,
On Mon, Oct 02, 2017 at 05:23:48PM +0200, Hans de Goede wrote:
> 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>
> ---
> drivers/bluetooth/hci_ldisc.c | 6 ++++++
> 1 file changed, 6 insertions(+)
>
> diff --git a/drivers/bluetooth/hci_ldisc.c b/drivers/bluetooth/hci_ldisc.c
> index a746627e784e..d02f6d029093 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,11 @@ 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);
> + return;
> + }
I think this should also control rts, so that the behaviour is the
same for serdev and ldisc implementation:
serdev_device_set_rts(serdev, enable);
> +
> if (enable) {
> /* Disable hardware flow control */
> ktermios = tty->termios;
-- Sebastian
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
next prev parent reply other threads:[~2017-10-02 22:34 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-10-02 15:23 [PATCH 0/9] Bluetooth: hci_bcm: Add (runtime)pm support to the serdev drv Hans de Goede
2017-10-02 15:23 ` [PATCH 1/9] Bluetooth: hci_uart_set_flow_control: Fix NULL deref when using serdev Hans de Goede
2017-10-02 22:34 ` Sebastian Reichel [this message]
2017-10-04 18:42 ` Hans de Goede
2017-10-02 15:23 ` [PATCH 2/9] Bluetooth: hci_bcm: Fix setting of irq trigger type Hans de Goede
2017-10-02 15:23 ` [PATCH 3/9] Bluetooth: hci_bcm: Move bcm_platform_probe call out of bcm_acpi_probe Hans de Goede
2017-10-02 15:23 ` [PATCH 4/9] Bluetooth: hci_bcm: Move platform_get_irq call to bcm_probe Hans de Goede
2017-10-02 15:23 ` [PATCH 5/9] Bluetooth: hci_bcm: Store device pointer instead of platform_device pointer Hans de Goede
2017-10-02 15:23 ` [PATCH 6/9] Bluetooth: hci_bcm: Rename bcm_platform_probe to bcm_get_resources Hans de Goede
2017-10-02 15:23 ` [PATCH 7/9] Bluetooth: hci_bcm: Make acpi_probe get irq from ACPI resources Hans de Goede
2017-10-03 17:21 ` Frédéric Danis
2017-10-04 13:26 ` Hans de Goede
2017-10-02 15:23 ` [PATCH 8/9] Bluetooth: hci_bcm: Make suspend/resume functions platform_dev independent Hans de Goede
2017-10-02 15:23 ` [PATCH 9/9] Bluetooth: hci_bcm: Add (runtime)pm support to the serdev driver Hans de Goede
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=20171002223415.jmbi4zw7edyuxccl@earth \
--to=sre@kernel.org \
--cc=frederic.danis.oss@gmail.com \
--cc=gustavo@padovan.org \
--cc=hdegoede@redhat.com \
--cc=johan.hedberg@gmail.com \
--cc=linux-acpi@vger.kernel.org \
--cc=linux-bluetooth@vger.kernel.org \
--cc=linux-serial@vger.kernel.org \
--cc=marcel@holtmann.org \
--cc=robh@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).