summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWei Yongjun <weiyongjun1@huawei.com>2019-07-10 08:12:22 +0200
committerMarcel Holtmann <marcel@holtmann.org>2019-08-12 18:23:49 +0200
commit5ee6310fb163ba7c66718905d4a19f1e71e641e0 (patch)
treeca1a6073ddb13e8ea0e4d50b47dd2aa0f5578498
parentnet: tc35815: Explicitly check NET_IP_ALIGN is not zero in tc35815_rx (diff)
downloadlinux-5ee6310fb163ba7c66718905d4a19f1e71e641e0.tar.xz
linux-5ee6310fb163ba7c66718905d4a19f1e71e641e0.zip
Bluetooth: btusb: Fix error return code in btusb_mtk_setup_firmware()
Fix to return error code -EINVAL from the error handling case instead of 0, as done elsewhere in this function. Fixes: a1c49c434e15 ("Bluetooth: btusb: Add protocol support for MediaTek MT7668U USB devices") Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com> Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
-rw-r--r--drivers/bluetooth/btusb.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/bluetooth/btusb.c b/drivers/bluetooth/btusb.c
index 3876fee6ad13..5cf0734eb31b 100644
--- a/drivers/bluetooth/btusb.c
+++ b/drivers/bluetooth/btusb.c
@@ -2762,8 +2762,10 @@ static int btusb_mtk_setup_firmware(struct hci_dev *hdev, const char *fwname)
fw_size = fw->size;
/* The size of patch header is 30 bytes, should be skip */
- if (fw_size < 30)
+ if (fw_size < 30) {
+ err = -EINVAL;
goto err_release_fw;
+ }
fw_size -= 30;
fw_ptr += 30;