projects
/
openwrt
/
staging
/
blogic.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
fb856e5
)
Bluetooth: Force -EIO from tty read/write if .activate() fails
author
Peter Hurley
<
[email protected]
>
Mon, 10 Feb 2014 01:59:21 +0000
(20:59 -0500)
committer
Marcel Holtmann
<
[email protected]
>
Fri, 14 Feb 2014 21:39:32 +0000
(13:39 -0800)
If rfcomm_dlc_open() fails, set tty into error state which returns
-EIO from reads and writes.
Signed-off-by: Peter Hurley <
[email protected]
>
Tested-By: Alexander Holler <
[email protected]
>
Signed-off-by: Marcel Holtmann <
[email protected]
>
net/bluetooth/rfcomm/tty.c
patch
|
blob
|
history
diff --git
a/net/bluetooth/rfcomm/tty.c
b/net/bluetooth/rfcomm/tty.c
index 375b60dae04dc2f80e078d395ae34d69558faa15..f6b9f0c4c29e49bb846319e3809eaf46aa5071ac 100644
(file)
--- a/
net/bluetooth/rfcomm/tty.c
+++ b/
net/bluetooth/rfcomm/tty.c
@@
-111,8
+111,12
@@
static void rfcomm_dev_destruct(struct tty_port *port)
static int rfcomm_dev_activate(struct tty_port *port, struct tty_struct *tty)
{
struct rfcomm_dev *dev = container_of(port, struct rfcomm_dev, port);
+ int err;
- return rfcomm_dlc_open(dev->dlc, &dev->src, &dev->dst, dev->channel);
+ err = rfcomm_dlc_open(dev->dlc, &dev->src, &dev->dst, dev->channel);
+ if (err)
+ set_bit(TTY_IO_ERROR, &tty->flags);
+ return err;
}
/* we block the open until the dlc->state becomes BT_CONNECTED */