linux-bluetooth.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH -next] Bluetooth: btusb: Fix error return code in btusb_mtk_setup_firmware()
@ 2019-07-10  6:12 Wei Yongjun
  2019-07-11  7:05 ` Marcel Holtmann
  0 siblings, 1 reply; 2+ messages in thread
From: Wei Yongjun @ 2019-07-10  6:12 UTC (permalink / raw)
  To: Marcel Holtmann, Johan Hedberg, Matthias Brugger, Sean Wang
  Cc: Wei Yongjun, linux-bluetooth, linux-arm-kernel, linux-mediatek,
	kernel-janitors

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>
---
 drivers/bluetooth/btusb.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

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;




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

* Re: [PATCH -next] Bluetooth: btusb: Fix error return code in btusb_mtk_setup_firmware()
  2019-07-10  6:12 [PATCH -next] Bluetooth: btusb: Fix error return code in btusb_mtk_setup_firmware() Wei Yongjun
@ 2019-07-11  7:05 ` Marcel Holtmann
  0 siblings, 0 replies; 2+ messages in thread
From: Marcel Holtmann @ 2019-07-11  7:05 UTC (permalink / raw)
  To: Wei Yongjun
  Cc: Johan Hedberg, Matthias Brugger, Sean Wang,
	Linux Bluetooth mailing list, linux-arm-kernel, linux-mediatek,
	kernel-janitors

Hi Wei,

> 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>
> ---
> drivers/bluetooth/btusb.c | 4 +++-
> 1 file changed, 3 insertions(+), 1 deletion(-)

patch has been applied to bluetooth-next tree.

Regards

Marcel


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

end of thread, other threads:[~2019-07-11  7:05 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-07-10  6:12 [PATCH -next] Bluetooth: btusb: Fix error return code in btusb_mtk_setup_firmware() Wei Yongjun
2019-07-11  7:05 ` 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).