linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] Bluetooth: hci_ll: Fix download_firmware() return when __hci_cmd_sync fails
@ 2017-05-22 13:50 Guodong Xu
  2017-05-23 13:45 ` Rob Herring
  2017-05-23 14:18 ` Marcel Holtmann
  0 siblings, 2 replies; 3+ messages in thread
From: Guodong Xu @ 2017-05-22 13:50 UTC (permalink / raw)
  To: linux-arm-kernel

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

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [PATCH] Bluetooth: hci_ll: Fix download_firmware() return when __hci_cmd_sync fails
  2017-05-22 13:50 [PATCH] Bluetooth: hci_ll: Fix download_firmware() return when __hci_cmd_sync fails Guodong Xu
@ 2017-05-23 13:45 ` Rob Herring
  2017-05-23 14:18 ` Marcel Holtmann
  1 sibling, 0 replies; 3+ messages in thread
From: Rob Herring @ 2017-05-23 13:45 UTC (permalink / raw)
  To: linux-arm-kernel

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>

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [PATCH] Bluetooth: hci_ll: Fix download_firmware() return when __hci_cmd_sync fails
  2017-05-22 13:50 [PATCH] Bluetooth: hci_ll: Fix download_firmware() return when __hci_cmd_sync fails Guodong Xu
  2017-05-23 13:45 ` Rob Herring
@ 2017-05-23 14:18 ` Marcel Holtmann
  1 sibling, 0 replies; 3+ messages in thread
From: Marcel Holtmann @ 2017-05-23 14:18 UTC (permalink / raw)
  To: linux-arm-kernel

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

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2017-05-23 14:18 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-05-22 13:50 [PATCH] Bluetooth: hci_ll: Fix download_firmware() return when __hci_cmd_sync fails Guodong Xu
2017-05-23 13:45 ` Rob Herring
2017-05-23 14:18 ` Marcel Holtmann

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).