Message ID | 20250121151532.2.I6e9e94dcded65e4a9ed42ad23ca8a5d81f680382@changeid (mailing list archive) |
---|---|
State | Superseded |
Headers | show |
Series | [1/2] Bluetooth: Fix possible race with userspace of sysfs isoc_alt | expand |
Context | Check | Description |
---|---|---|
tedd_an/pre-ci_am | success | Success |
tedd_an/SubjectPrefix | success | Gitlint PASS |
HI Hsin-chen, On Tue, Jan 21, 2025 at 2:17 AM Hsin-chen Chuang <chharry@google.com> wrote: > > From: Hsin-chen Chuang <chharry@chromium.org> > > The SCO packets from Bluetooth raw socket are now rejected because > hci_conn_num is left 0. This patch allows such the usecase to enable > the userspace SCO support. > > Fixes: b16b327edb4d ("Bluetooth: btusb: add sysfs attribute to control USB alt setting") > Signed-off-by: Hsin-chen Chuang <chharry@chromium.org> > --- > > drivers/bluetooth/btusb.c | 6 ------ > 1 file changed, 6 deletions(-) > > diff --git a/drivers/bluetooth/btusb.c b/drivers/bluetooth/btusb.c > index f419d0827ee4..3e2d7ea6de5c 100644 > --- a/drivers/bluetooth/btusb.c > +++ b/drivers/bluetooth/btusb.c > @@ -2107,9 +2107,6 @@ static int btusb_send_frame(struct hci_dev *hdev, struct sk_buff *skb) > return submit_or_queue_tx_urb(hdev, urb); > > case HCI_SCODATA_PKT: > - if (hci_conn_num(hdev, SCO_LINK) < 1) > - return -ENODEV; Hmm, we probably need to check if USER_CHANNEL has been opened instead of simply removing the check. > - > urb = alloc_isoc_urb(hdev, skb); > if (IS_ERR(urb)) > return PTR_ERR(urb); > @@ -2588,9 +2585,6 @@ static int btusb_send_frame_intel(struct hci_dev *hdev, struct sk_buff *skb) > return submit_or_queue_tx_urb(hdev, urb); > > case HCI_SCODATA_PKT: > - if (hci_conn_num(hdev, SCO_LINK) < 1) > - return -ENODEV; > - > urb = alloc_isoc_urb(hdev, skb); > if (IS_ERR(urb)) > return PTR_ERR(urb); > -- > 2.48.0.rc2.279.g1de40edade-goog >
diff --git a/drivers/bluetooth/btusb.c b/drivers/bluetooth/btusb.c index f419d0827ee4..3e2d7ea6de5c 100644 --- a/drivers/bluetooth/btusb.c +++ b/drivers/bluetooth/btusb.c @@ -2107,9 +2107,6 @@ static int btusb_send_frame(struct hci_dev *hdev, struct sk_buff *skb) return submit_or_queue_tx_urb(hdev, urb); case HCI_SCODATA_PKT: - if (hci_conn_num(hdev, SCO_LINK) < 1) - return -ENODEV; - urb = alloc_isoc_urb(hdev, skb); if (IS_ERR(urb)) return PTR_ERR(urb); @@ -2588,9 +2585,6 @@ static int btusb_send_frame_intel(struct hci_dev *hdev, struct sk_buff *skb) return submit_or_queue_tx_urb(hdev, urb); case HCI_SCODATA_PKT: - if (hci_conn_num(hdev, SCO_LINK) < 1) - return -ENODEV; - urb = alloc_isoc_urb(hdev, skb); if (IS_ERR(urb)) return PTR_ERR(urb);