summaryrefslogtreecommitdiffstats
path: root/drivers/bluetooth
diff options
context:
space:
mode:
authorSean Wang <sean.wang@mediatek.com>2019-02-14 18:19:35 -0500
committerMarcel Holtmann <marcel@holtmann.org>2019-02-18 08:06:38 -0500
commit77f328dbc6cf42f22c691a164958a5452142a542 (patch)
tree3609f84a37e0dbd7b22bebb7afb8da7faa06ab0e /drivers/bluetooth
parentadf5d73056d185eff31a04aa91f5cb0a2ae22152 (diff)
Bluetooth: mediatek: fix up an error path to restore bdev->tx_state
Restore bdev->tx_state with clearing bit BTMTKUART_TX_WAIT_VND_EVT when there is an error on waiting for the corresponding event. Fixes: 7237c4c9ec92 ("Bluetooth: mediatek: Add protocol support for MediaTek serial devices") Signed-off-by: Sean Wang <sean.wang@mediatek.com> Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
Diffstat (limited to 'drivers/bluetooth')
-rw-r--r--drivers/bluetooth/btmtkuart.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/bluetooth/btmtkuart.c b/drivers/bluetooth/btmtkuart.c
index b8ea011b82d8..9f8177b216b6 100644
--- a/drivers/bluetooth/btmtkuart.c
+++ b/drivers/bluetooth/btmtkuart.c
@@ -115,11 +115,13 @@ static int mtk_hci_wmt_sync(struct hci_dev *hdev, u8 op, u8 flag, u16 plen,
115 TASK_INTERRUPTIBLE, HCI_INIT_TIMEOUT); 115 TASK_INTERRUPTIBLE, HCI_INIT_TIMEOUT);
116 if (err == -EINTR) { 116 if (err == -EINTR) {
117 bt_dev_err(hdev, "Execution of wmt command interrupted"); 117 bt_dev_err(hdev, "Execution of wmt command interrupted");
118 clear_bit(BTMTKUART_TX_WAIT_VND_EVT, &bdev->tx_state);
118 return err; 119 return err;
119 } 120 }
120 121
121 if (err) { 122 if (err) {
122 bt_dev_err(hdev, "Execution of wmt command timed out"); 123 bt_dev_err(hdev, "Execution of wmt command timed out");
124 clear_bit(BTMTKUART_TX_WAIT_VND_EVT, &bdev->tx_state);
123 return -ETIMEDOUT; 125 return -ETIMEDOUT;
124 } 126 }
125 127