From 018c778689c84a905e274548c1e37b3cbd2704e3 Mon Sep 17 00:00:00 2001 From: Alan Cox Date: Fri, 22 Oct 2010 14:11:26 +0100 Subject: [PATCH] --- yaml --- r: 212906 b: refs/heads/master c: c19483cc5e56ac5e22dd19cf25ba210ab1537773 h: refs/heads/master v: v3 --- [refs] | 2 +- trunk/drivers/bluetooth/hci_ldisc.c | 7 +++++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/[refs] b/[refs] index 5df2d2218367..726fb19d73f3 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: d4429f608abde89e8bc1e24b43cd503feb95c496 +refs/heads/master: c19483cc5e56ac5e22dd19cf25ba210ab1537773 diff --git a/trunk/drivers/bluetooth/hci_ldisc.c b/trunk/drivers/bluetooth/hci_ldisc.c index 998833d93c13..17361bad46dd 100644 --- a/trunk/drivers/bluetooth/hci_ldisc.c +++ b/trunk/drivers/bluetooth/hci_ldisc.c @@ -256,9 +256,16 @@ static int hci_uart_tty_open(struct tty_struct *tty) BT_DBG("tty %p", tty); + /* FIXME: This btw is bogus, nothing requires the old ldisc to clear + the pointer */ if (hu) return -EEXIST; + /* Error if the tty has no write op instead of leaving an exploitable + hole */ + if (tty->ops->write == NULL) + return -EOPNOTSUPP; + if (!(hu = kzalloc(sizeof(struct hci_uart), GFP_KERNEL))) { BT_ERR("Can't allocate control structure"); return -ENFILE;