]> Pileus Git - ~andy/linux/blobdiff - drivers/bluetooth/hci_ldisc.c
regulator: max8998 BUCK1/2 voltage change with use of GPIOs
[~andy/linux] / drivers / bluetooth / hci_ldisc.c
index 74cb6f3e86c571c40fa9127d734183e97f0ab65d..720148294e648473a1a82cc0c68f50ac1fd923c3 100644 (file)
@@ -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;