Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1646922 > unrolled thread

[PATCH] Bluetooth: hci_ll: Fix download_firmware() return when __hci_cmd_sync fails

Started byGuodong Xu <guodong.xu@linaro.org>
First post2017-05-22 16:00 +0200
Last post2017-05-23 16:20 +0200
Articles 3 — 3 participants

Back to article view | Back to linux.kernel


Contents

  [PATCH] Bluetooth: hci_ll: Fix download_firmware() return when __hci_cmd_sync fails Guodong Xu <guodong.xu@linaro.org> - 2017-05-22 16:00 +0200
    Re: [PATCH] Bluetooth: hci_ll: Fix download_firmware() return when  __hci_cmd_sync fails Rob Herring <robh@kernel.org> - 2017-05-23 15:50 +0200
    Re: [PATCH] Bluetooth: hci_ll: Fix download_firmware() return when  __hci_cmd_sync fails Marcel Holtmann <marcel@holtmann.org> - 2017-05-23 16:20 +0200

#1646922 — [PATCH] Bluetooth: hci_ll: Fix download_firmware() return when __hci_cmd_sync fails

FromGuodong Xu <guodong.xu@linaro.org>
Date2017-05-22 16:00 +0200
Subject[PATCH] Bluetooth: hci_ll: Fix download_firmware() return when __hci_cmd_sync fails
Message-ID<tJW2l-6oO-3@gated-at.bofh.it>
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>
---
 drivers/bluetooth/hci_ll.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/bluetooth/hci_ll.c b/drivers/bluetooth/hci_ll.c
index adc444f..200288c 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);
-- 
2.10.2

[toc] | [next] | [standalone]


#1648080 — Re: [PATCH] Bluetooth: hci_ll: Fix download_firmware() return when __hci_cmd_sync fails

FromRob Herring <robh@kernel.org>
Date2017-05-23 15:50 +0200
SubjectRe: [PATCH] Bluetooth: hci_ll: Fix download_firmware() return when __hci_cmd_sync fails
Message-ID<tKime-3Tp-35@gated-at.bofh.it>
In reply to#1646922
On Mon, May 22, 2017 at 8:50 AM, Guodong Xu <guodong.xu@linaro.org> wrote:
> 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>
> ---
>  drivers/bluetooth/hci_ll.c | 1 +
>  1 file changed, 1 insertion(+)

Acked-by: Rob Herring <robh@kernel.org>

[toc] | [prev] | [next] | [standalone]


#1648119 — Re: [PATCH] Bluetooth: hci_ll: Fix download_firmware() return when __hci_cmd_sync fails

FromMarcel Holtmann <marcel@holtmann.org>
Date2017-05-23 16:20 +0200
SubjectRe: [PATCH] Bluetooth: hci_ll: Fix download_firmware() return when __hci_cmd_sync fails
Message-ID<tKiPh-4kM-41@gated-at.bofh.it>
In reply to#1646922
Hi Guodong,

> 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>
> ---
> drivers/bluetooth/hci_ll.c | 1 +
> 1 file changed, 1 insertion(+)

patch has been applied to bluetooth-next tree.

Regards

Marcel

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web