[PATCH 1/4] Bluetooth: btmtksdio: Fix runtime PM leak in btmtksdio_reset()
From: Wentao Liang
Date: Mon Sep 14 2026 - 23:52:51 EST
btmtksdio_reset() takes a runtime PM reference with
pm_runtime_get_sync(bdev->dev), which leaves the device's usage
count incremented even when it fails. However, when the reset has
already been started (BTMTKSDIO_HW_RESET_ACTIVE is found set by
test_and_set_bit()), the function returns early without dropping
that reference, leaking it on every concurrent reset request.
Add a pm_runtime_put_noidle() on the early-exit path to keep the
usage count balanced.
Fixes: 8fafe702253d ("Bluetooth: mt7921s: support bluetooth reset mechanism")
Cc: stable@xxxxxxxxxxxxxxx
Signed-off-by: Wentao Liang <vulab@xxxxxxxxxxx>
---
drivers/bluetooth/btmtksdio.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/drivers/bluetooth/btmtksdio.c b/drivers/bluetooth/btmtksdio.c
index 5b0fab7b89b5..243215a81fa7 100644
--- a/drivers/bluetooth/btmtksdio.c
+++ b/drivers/bluetooth/btmtksdio.c
@@ -1280,8 +1280,10 @@ static void btmtksdio_reset(struct hci_dev *hdev)
pm_runtime_get_sync(bdev->dev);
- if (test_and_set_bit(BTMTKSDIO_HW_RESET_ACTIVE, &bdev->tx_state))
+ if (test_and_set_bit(BTMTKSDIO_HW_RESET_ACTIVE, &bdev->tx_state)) {
+ pm_runtime_put_noidle(bdev->dev);
return;
+ }
sdio_claim_host(bdev->func);
--
2.34.1