diff mbox series

[v2] Bluetooth: bfusb: Check the endpoint type at probe

Message ID 20220513140759.2196755-1-zheyuma97@gmail.com (mailing list archive)
State New, archived
Headers show
Series [v2] Bluetooth: bfusb: Check the endpoint type at probe | expand

Checks

Context Check Description
tedd_an/pre-ci_am success Success
tedd_an/checkpatch success Checkpatch PASS
tedd_an/gitlint success Gitlint PASS
tedd_an/subjectprefix success PASS
tedd_an/buildkernel success Build Kernel PASS
tedd_an/buildkernel32 success Build Kernel32 PASS
tedd_an/incremental_build success Pass
tedd_an/testrunnersetup success Test Runner Setup PASS
tedd_an/testrunnerl2cap-tester success Total: 40, Passed: 40 (100.0%), Failed: 0, Not Run: 0
tedd_an/testrunnerbnep-tester success Total: 1, Passed: 1 (100.0%), Failed: 0, Not Run: 0
tedd_an/testrunnermgmt-tester success Total: 493, Passed: 493 (100.0%), Failed: 0, Not Run: 0
tedd_an/testrunnerrfcomm-tester success Total: 10, Passed: 10 (100.0%), Failed: 0, Not Run: 0
tedd_an/testrunnersco-tester success Total: 12, Passed: 12 (100.0%), Failed: 0, Not Run: 0
tedd_an/testrunnersmp-tester success Total: 8, Passed: 8 (100.0%), Failed: 0, Not Run: 0
tedd_an/testrunneruserchan-tester success Total: 4, Passed: 4 (100.0%), Failed: 0, Not Run: 0

Commit Message

Zheyu Ma May 13, 2022, 2:07 p.m. UTC
The driver reported an warning in usb_submit_urb() which is caused by
wrong endpoint type.

usb 1-1: BOGUS urb xfer, pipe 3 != type 1
WARNING: at drivers/usb/core/urb.c:503 usb_submit_urb+0xcd9/0x18b0
RIP: 0010:usb_submit_urb+0xcd9/0x18b0
Call Trace:
 <TASK>
 bfusb_rx_submit+0x24e/0x390 [bfusb]
 bfusb_open+0x50/0x90 [bfusb]

Fix this by checking the endpoint type at first.

Signed-off-by: Zheyu Ma <zheyuma97@gmail.com>
---
Changes in v2:
    - Format the commit message
---
 drivers/bluetooth/bfusb.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

Comments

bluez.test.bot@gmail.com May 13, 2022, 2:39 p.m. UTC | #1
This is automated email and please do not reply to this email!

Dear submitter,

Thank you for submitting the patches to the linux bluetooth mailing list.
This is a CI test results with your patch series:
PW Link:https://patchwork.kernel.org/project/bluetooth/list/?series=641424

---Test result---

Test Summary:
CheckPatch                    PASS      1.70 seconds
GitLint                       PASS      1.05 seconds
SubjectPrefix                 PASS      0.93 seconds
BuildKernel                   PASS      40.06 seconds
BuildKernel32                 PASS      35.18 seconds
Incremental Build with patchesPASS      47.73 seconds
TestRunner: Setup             PASS      588.75 seconds
TestRunner: l2cap-tester      PASS      19.89 seconds
TestRunner: bnep-tester       PASS      7.37 seconds
TestRunner: mgmt-tester       PASS      118.24 seconds
TestRunner: rfcomm-tester     PASS      11.25 seconds
TestRunner: sco-tester        PASS      10.99 seconds
TestRunner: smp-tester        PASS      11.14 seconds
TestRunner: userchan-tester   PASS      7.70 seconds



---
Regards,
Linux Bluetooth
diff mbox series

Patch

diff --git a/drivers/bluetooth/bfusb.c b/drivers/bluetooth/bfusb.c
index cab93935cc7f..447b6876c552 100644
--- a/drivers/bluetooth/bfusb.c
+++ b/drivers/bluetooth/bfusb.c
@@ -613,7 +613,9 @@  static int bfusb_probe(struct usb_interface *intf, const struct usb_device_id *i
 	bulk_out_ep = &intf->cur_altsetting->endpoint[0];
 	bulk_in_ep  = &intf->cur_altsetting->endpoint[1];
 
-	if (!bulk_out_ep || !bulk_in_ep) {
+	if (!bulk_out_ep || !bulk_in_ep ||
+		!usb_endpoint_is_bulk_out(&bulk_out_ep->desc) ||
+		!usb_endpoint_is_bulk_in(&bulk_in_ep->desc)) {
 		BT_ERR("Bulk endpoints not found");
 		goto done;
 	}