Message ID | 20220602094645.1.I7d191480c15b45a237b927e26aa26ba806409efb@changeid |
---|---|
State | New |
Headers | show |
Series | [1/2] Bluetooth: Fix index added after unregister | expand |
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=646945 ---Test result--- Test Summary: CheckPatch PASS 3.66 seconds GitLint FAIL 1.03 seconds SubjectPrefix PASS 1.74 seconds BuildKernel PASS 31.77 seconds BuildKernel32 PASS 28.08 seconds Incremental Build with patchesPASS 65.60 seconds TestRunner: Setup PASS 475.78 seconds TestRunner: l2cap-tester PASS 17.44 seconds TestRunner: bnep-tester PASS 6.11 seconds TestRunner: mgmt-tester PASS 101.81 seconds TestRunner: rfcomm-tester PASS 9.61 seconds TestRunner: sco-tester PASS 9.37 seconds TestRunner: smp-tester PASS 9.40 seconds TestRunner: userchan-tester PASS 6.41 seconds Details ############################## Test: GitLint - FAIL - 1.03 seconds Run gitlint with rule in .gitlint [1/2] Bluetooth: Fix index added after unregister 24: B1 Line exceeds max length (82>80): " @ MGMT Open: bt_stack_manage (privileged) version 1.14 {0x0003} 682.437223" 25: B1 Line exceeds max length (82>80): " @ MGMT Command: Read Controller Index List (0x0003) plen 0 {0x0003} 682.437230" 26: B1 Line exceeds max length (82>80): " @ MGMT Event: Command Complete (0x0001) plen 5 {0x0003} 682.437232" --- Regards, Linux Bluetooth
Hello: This series was applied to bluetooth/bluetooth-next.git (master) by Marcel Holtmann <marcel@holtmann.org>: On Thu, 2 Jun 2022 09:46:49 -0700 you wrote: > From: Abhishek Pandit-Subedi <abhishekpandit@chromium.org> > > When a userchannel socket is released, we should check whether the hdev > is already unregistered before sending out an IndexAdded. > > Signed-off-by: Abhishek Pandit-Subedi <abhishekpandit@chromium.org> > > [...] Here is the summary with links: - [1/2] Bluetooth: Fix index added after unregister https://git.kernel.org/bluetooth/bluetooth-next/c/8d4b73539cca - [2/2] Bluetooth: Unregister suspend with userchannel https://git.kernel.org/bluetooth/bluetooth-next/c/d6bb2a91f95b You are awesome, thank you!
diff --git a/net/bluetooth/hci_sock.c b/net/bluetooth/hci_sock.c index 189e3115c8c6..bd8358b44aa4 100644 --- a/net/bluetooth/hci_sock.c +++ b/net/bluetooth/hci_sock.c @@ -869,7 +869,8 @@ static int hci_sock_release(struct socket *sock) hdev = hci_pi(sk)->hdev; if (hdev) { - if (hci_pi(sk)->channel == HCI_CHANNEL_USER) { + if (hci_pi(sk)->channel == HCI_CHANNEL_USER && + !hci_dev_test_flag(hdev, HCI_UNREGISTER)) { /* When releasing a user channel exclusive access, * call hci_dev_do_close directly instead of calling * hci_dev_close to ensure the exclusive access will @@ -878,6 +879,11 @@ static int hci_sock_release(struct socket *sock) * The checking of HCI_AUTO_OFF is not needed in this * case since it will have been cleared already when * opening the user channel. + * + * Make sure to also check that we haven't already + * unregistered since all the cleanup will have already + * been complete and hdev will get released when we put + * below. */ hci_dev_do_close(hdev); hci_dev_clear_flag(hdev, HCI_USER_CHANNEL);