| Submitter | Brad Figg |
|---|---|
| Date | Feb. 11, 2011, 8:35 p.m. |
| Message ID | <1297456520-4811-2-git-send-email-brad.figg@canonical.com> |
| Download | mbox | patch |
| Permalink | /patch/82825/ |
| State | Accepted |
| Commit | 2b4d107cba9ec532e112376537273155825999cf |
| Headers | show |
Comments
Patch
diff --git a/drivers/bluetooth/hci_ldisc.c b/drivers/bluetooth/hci_ldisc.c index 573ff6c..68a4649 100644 --- a/drivers/bluetooth/hci_ldisc.c +++ b/drivers/bluetooth/hci_ldisc.c @@ -269,9 +269,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->driver->write == NULL) + return -EOPNOTSUPP; + if (!(hu = kzalloc(sizeof(struct hci_uart), GFP_KERNEL))) { BT_ERR("Can't allocate controll structure"); return -ENFILE;