diff options
author | David S. Miller <davem@davemloft.net> | 2018-08-22 22:43:11 -0700 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2018-08-22 22:43:11 -0700 |
commit | 0d092f06faa46b95a8e07b9bb5737b7c0f1176ee (patch) | |
tree | d111a942e7969c8ec34f1f74542ddda7ccc83b00 | |
parent | 6bfde2e196d8ddfea5317be986809abdb0be5a0c (diff) | |
parent | addb3ffbca66954fb1d1791d2db2153c403f81af (diff) |
Merge branch 'for-upstream' of git://git.kernel.org/pub/scm/linux/kernel/git/bluetooth/bluetooth
Johan Hedberg says:
====================
pull request: bluetooth 2018-08-23
Here are two important Bluetooth fixes for the MediaTek and RealTek HCI
drivers.
Please let me know if there are any issues pulling, thanks.
====================
Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r-- | drivers/bluetooth/Kconfig | 1 | ||||
-rw-r--r-- | drivers/bluetooth/btmtkuart.c | 8 |
2 files changed, 6 insertions, 3 deletions
diff --git a/drivers/bluetooth/Kconfig b/drivers/bluetooth/Kconfig index 2df11cc08a46..845b0314ce3a 100644 --- a/drivers/bluetooth/Kconfig +++ b/drivers/bluetooth/Kconfig @@ -200,6 +200,7 @@ config BT_HCIUART_RTL depends on BT_HCIUART depends on BT_HCIUART_SERDEV depends on GPIOLIB + depends on ACPI select BT_HCIUART_3WIRE select BT_RTL help diff --git a/drivers/bluetooth/btmtkuart.c b/drivers/bluetooth/btmtkuart.c index ed2a5c7cb77f..4593baff2bc9 100644 --- a/drivers/bluetooth/btmtkuart.c +++ b/drivers/bluetooth/btmtkuart.c @@ -144,8 +144,10 @@ static int mtk_setup_fw(struct hci_dev *hdev) fw_size = fw->size; /* The size of patch header is 30 bytes, should be skip */ - if (fw_size < 30) - return -EINVAL; + if (fw_size < 30) { + err = -EINVAL; + goto free_fw; + } fw_size -= 30; fw_ptr += 30; @@ -172,8 +174,8 @@ static int mtk_setup_fw(struct hci_dev *hdev) fw_ptr += dlen; } +free_fw: release_firmware(fw); - return err; } |