Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 7 additions & 8 deletions drivers/bluetooth/btmtk.c
Original file line number Diff line number Diff line change
Expand Up @@ -620,17 +620,14 @@ static int btmtk_usb_hci_wmt_sync(struct hci_dev *hdev,

if (err < 0) {
clear_bit(BTMTK_TX_WAIT_VND_EVT, &data->flags);
usb_autopm_put_interface(data->intf);
goto err_free_wc;
goto err_pm_put;
}

/* Submit control IN URB on demand to process the WMT event */
err = btmtk_usb_submit_wmt_recv_urb(hdev);

usb_autopm_put_interface(data->intf);

if (err < 0)
goto err_free_wc;
goto err_pm_put;

/* The vendor specific WMT commands are all answered by a vendor
* specific event and will have the Command Status or Command
Expand All @@ -646,18 +643,18 @@ static int btmtk_usb_hci_wmt_sync(struct hci_dev *hdev,
if (err == -EINTR) {
bt_dev_err(hdev, "Execution of wmt command interrupted");
clear_bit(BTMTK_TX_WAIT_VND_EVT, &data->flags);
goto err_free_wc;
goto err_pm_put;
}

if (err) {
bt_dev_err(hdev, "Execution of wmt command timed out");
clear_bit(BTMTK_TX_WAIT_VND_EVT, &data->flags);
err = -ETIMEDOUT;
goto err_free_wc;
goto err_pm_put;
}

if (data->evt_skb == NULL)
goto err_free_wc;
goto err_pm_put;

/* Parse and handle the return WMT event */
wmt_evt = (struct btmtk_hci_wmt_evt *)data->evt_skb->data;
Expand Down Expand Up @@ -700,6 +697,8 @@ static int btmtk_usb_hci_wmt_sync(struct hci_dev *hdev,
err_free_skb:
kfree_skb(data->evt_skb);
data->evt_skb = NULL;
err_pm_put:
usb_autopm_put_interface(data->intf);
err_free_wc:
kfree(wc);
return err;
Expand Down
Loading