summaryrefslogtreecommitdiffstats
path: root/drivers/bluetooth/hci_ll.c
diff options
context:
space:
mode:
authorGuodong Xu <guodong.xu@linaro.org>2017-05-22 21:50:42 +0800
committerMarcel Holtmann <marcel@holtmann.org>2017-05-23 16:16:31 +0200
commit823b84201f4a719414d61b105fd23706c5668ab5 (patch)
tree2cbad61b7860c7bfe0d50cc71b068020cb807d63 /drivers/bluetooth/hci_ll.c
parent3a21bf586dd012e82abbd4dcedafdfa991f02fa3 (diff)
downloadlinux-823b84201f4a719414d61b105fd23706c5668ab5.tar.bz2
Bluetooth: hci_ll: Fix download_firmware() return when __hci_cmd_sync fails
When __hci_cmd_sync() fails, download_firmware() should also fail, and the same error value should be returned as PTR_ERR(skb). Without this fix, download_firmware() will return a success when it actually failed in __hci_cmd_sync(). Fixes: 371805522f87 ("bluetooth: hci_uart: add LL protocol serdev driver support") Signed-off-by: Guodong Xu <guodong.xu@linaro.org> Acked-by: Rob Herring <robh@kernel.org> Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
Diffstat (limited to 'drivers/bluetooth/hci_ll.c')
-rw-r--r--drivers/bluetooth/hci_ll.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/bluetooth/hci_ll.c b/drivers/bluetooth/hci_ll.c
index adc444f309a3..200288c87fc4 100644
--- a/drivers/bluetooth/hci_ll.c
+++ b/drivers/bluetooth/hci_ll.c
@@ -624,6 +624,7 @@ static int download_firmware(struct ll_device *lldev)
skb = __hci_cmd_sync(lldev->hu.hdev, cmd->opcode, cmd->plen, &cmd->speed, HCI_INIT_TIMEOUT);
if (IS_ERR(skb)) {
bt_dev_err(lldev->hu.hdev, "send command failed\n");
+ err = PTR_ERR(skb);
goto out_rel_fw;
}
kfree_skb(skb);