aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/bluetooth/hci_ldisc.c
diff options
context:
space:
mode:
authorJiri Slaby <jslaby@suse.cz>2012-10-18 16:26:34 -0400
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2012-10-22 19:50:53 -0400
commitf327b340e35b210c936cd109544e672aa7a0e49d (patch)
treeee405740220bdf4d97653f7899e6118f71eb03de /drivers/bluetooth/hci_ldisc.c
parent31e121284f90bf559618330e230b286f969b6b7f (diff)
TTY: hci_ldisc, remove invalid check in open
hci_ldisc's open checks if tty_struct->disc_data is set. And if so it returns with an error. But nothing ensures disc_data to be NULL. And since ld->ops->open shall be called only once, we do not need the check at all. So remove it. Note that this is not an issue now, but n_tty will start using the disc_data pointer and this invalid 'if' would trigger then rendering TTYs over BT unusable. Signed-off-by: Jiri Slaby <jslaby@suse.cz> Acked-by: Marcel Holtmann <marcel@holtmann.org> Cc: Gustavo Padovan <gustavo@padovan.org> Cc: Johan Hedberg <johan.hedberg@gmail.com> Cc: linux-bluetooth@vger.kernel.org Acked-by: Alan Cox <alan@linux.intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/bluetooth/hci_ldisc.c')
-rw-r--r--drivers/bluetooth/hci_ldisc.c7
1 files changed, 1 insertions, 6 deletions
diff --git a/drivers/bluetooth/hci_ldisc.c b/drivers/bluetooth/hci_ldisc.c
index c8abce3d2d9c..ed0fade46aed 100644
--- a/drivers/bluetooth/hci_ldisc.c
+++ b/drivers/bluetooth/hci_ldisc.c
@@ -270,15 +270,10 @@ static int hci_uart_send_frame(struct sk_buff *skb)
270 */ 270 */
271static int hci_uart_tty_open(struct tty_struct *tty) 271static int hci_uart_tty_open(struct tty_struct *tty)
272{ 272{
273 struct hci_uart *hu = (void *) tty->disc_data; 273 struct hci_uart *hu;
274 274
275 BT_DBG("tty %p", tty); 275 BT_DBG("tty %p", tty);
276 276
277 /* FIXME: This btw is bogus, nothing requires the old ldisc to clear
278 the pointer */
279 if (hu)
280 return -EEXIST;
281
282 /* Error if the tty has no write op instead of leaving an exploitable 277 /* Error if the tty has no write op instead of leaving an exploitable
283 hole */ 278 hole */
284 if (tty->ops->write == NULL) 279 if (tty->ops->write == NULL)