Skip to content

[PW_SID:1124641] [v4] Bluetooth: virtio: Fix virtbt_probe() init and cleanup#418

Open
BluezTestBot wants to merge 6 commits into
workflowfrom
1124641
Open

[PW_SID:1124641] [v4] Bluetooth: virtio: Fix virtbt_probe() init and cleanup#418
BluezTestBot wants to merge 6 commits into
workflowfrom
1124641

Conversation

@BluezTestBot

Copy link
Copy Markdown

virtbt_probe() allocates vbt before setting up the virtqueues, but some
failure paths return without freeing it.

The probe path also registers the HCI device before the virtio transport
is opened. Since hci_register_dev() makes the HCI device visible and queues
power_on work, move it after virtio_device_ready() and virtbt_open_vdev()
so the transport is ready before the HCI core can use it.

On failures after DRIVER_OK, reset and close the virtio device before
deleting the virtqueues and freeing vbt. This also cancels pending rx work
before vbt is freed.

Fixes: afd2daa ("Bluetooth: Add support for virtio transport driver")
Fixes: dc65b4b ("Bluetooth: virtio_bt: fix device removal")
Cc: stable@vger.kernel.org
Signed-off-by: Haoxiang Li haoxiang_li2024@163.com

Changes in v2:

  • Rework virtbt_probe() error paths into an unwind ladder.

  • Free vbt on probe failures.

  • Reset the virtio device and unregister the HCI device before freeing it
    when virtbt_open_vdev() fails.

  • Close the virtio device before unregistering the HCI device in remove().

    Thanks Dan for the suggestions. The blog is very helpful.

Changes in v3:

  • Remove virtio_reset_device() from the virtbt_open_vdev() failure path.

Changes in v4:

  • Move hci_register_dev() after virtio_device_ready() and virtbt_open_vdev().
  • Reset and close the virtio device on probe failures after DRIVER_OK. Thanks, Luiz!

drivers/bluetooth/virtio_bt.c | 27 ++++++++++++++++-----------
1 file changed, 16 insertions(+), 11 deletions(-)

tedd-an and others added 6 commits July 8, 2026 16:32
This patch adds workflow files for ci:

[sync.yml]
 - The workflow file for scheduled work
 - Sync the repo with upstream repo and rebase the workflow branch
 - Review the patches in the patchwork and creates the PR if needed

[ci.yml]
 - The workflow file for CI tasks
 - Run CI tests when PR is created

Signed-off-by: Tedd Ho-Jeong An <tedd.an@intel.com>
This replaces the bzcafe action with bluez/action-ci so we can maintain
everything in the github bluez organization

Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
This attempts to sync every 5 minutes instead of 30.

Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
bluez/action-ci uses master as default branch for workflow which is
incorrect for kernel

Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
The CI action now creates individual GitHub Check Runs per test, which
requires 'checks: write' permission on the GITHUB_TOKEN. Also make the
pull_request trigger types explicit to include 'reopened', allowing CI
to be retriggered by closing and reopening a PR.
virtbt_probe() allocates vbt before setting up the virtqueues, but some
failure paths return without freeing it.

The probe path also registers the HCI device before the virtio transport
is opened. Since hci_register_dev() makes the HCI device visible and queues
power_on work, move it after virtio_device_ready() and virtbt_open_vdev()
so the transport is ready before the HCI core can use it.

On failures after DRIVER_OK, reset and close the virtio device before
deleting the virtqueues and freeing vbt. This also cancels pending rx work
before vbt is freed.

Fixes: afd2daa ("Bluetooth: Add support for virtio transport driver")
Fixes: dc65b4b ("Bluetooth: virtio_bt: fix device removal")
Cc: stable@vger.kernel.org
Signed-off-by: Haoxiang Li <haoxiang_li2024@163.com>
@github-actions

github-actions Bot commented Jul 9, 2026

Copy link
Copy Markdown

CheckPatch
Desc: Run checkpatch.pl script
Duration: 0.56 seconds
Result: PASS

@github-actions

github-actions Bot commented Jul 9, 2026

Copy link
Copy Markdown

VerifyFixes
Desc: Verify Fixes tag format and validity
Duration: 0.07 seconds
Result: PASS

@github-actions

github-actions Bot commented Jul 9, 2026

Copy link
Copy Markdown

VerifySignedoff
Desc: Verify Signed-off-by chain
Duration: 0.07 seconds
Result: PASS

@github-actions

github-actions Bot commented Jul 9, 2026

Copy link
Copy Markdown

GitLint
Desc: Run gitlint
Duration: 0.20 seconds
Result: FAIL
Output:

[v4] Bluetooth: virtio: Fix virtbt_probe() init and cleanup

32: B1 Line exceeds max length (85>80): " - Reset and close the virtio device on probe failures after DRIVER_OK. Thanks, Luiz!"

@github-actions

github-actions Bot commented Jul 9, 2026

Copy link
Copy Markdown

SubjectPrefix
Desc: Check subject contains "Bluetooth" prefix
Duration: 0.06 seconds
Result: PASS

@github-actions

github-actions Bot commented Jul 9, 2026

Copy link
Copy Markdown

BuildKernel
Desc: Build Kernel for Bluetooth
Duration: 26.91 seconds
Result: PASS

@github-actions

github-actions Bot commented Jul 9, 2026

Copy link
Copy Markdown

CheckAllWarning
Desc: Run linux kernel with all warning enabled
Duration: 29.72 seconds
Result: PASS

@github-actions

github-actions Bot commented Jul 9, 2026

Copy link
Copy Markdown

CheckSparse
Desc: Run sparse tool with linux kernel
Duration: 28.07 seconds
Result: PASS

@github-actions

github-actions Bot commented Jul 9, 2026

Copy link
Copy Markdown

BuildKernel32
Desc: Build 32bit Kernel for Bluetooth
Duration: 25.92 seconds
Result: PASS

@github-actions

github-actions Bot commented Jul 9, 2026

Copy link
Copy Markdown

CheckKernelLLVM
Desc: Build kernel with LLVM + context analysis
Duration: 0.00 seconds
Result: SKIP
Output:

Clang not found

@github-actions

github-actions Bot commented Jul 9, 2026

Copy link
Copy Markdown

TestRunnerSetup
Desc: Setup kernel and bluez for test-runner
Duration: 496.53 seconds
Result: PASS

@github-actions

github-actions Bot commented Jul 9, 2026

Copy link
Copy Markdown

IncrementalBuild
Desc: Incremental build with the patches in the series
Duration: 25.31 seconds
Result: PASS

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants